[prev in list] [next in list] [prev in thread] [next in thread] 

List:       turbine-torque-user
Subject:    Re: IdGenerator is null
From:       Don Vawter <don () vawter ! com>
Date:       2004-10-29 21:52:25
Message-ID: 4182BB99.4070909 () vawter ! com
[Download RAW message or body]

never mind. When I was changing the init statement for Torque I left 
both the old and new init's in the code.
It is a known result that initing it more than once leads to the 
exception shown. (thanks to 
http://wiki.apache.org/db-torque/GettingTorqueToWork )


Don Vawter wrote:

>
> This is appearing in the logs:
>
> DEBUG,2004-10-29 
> 13:07:28,com.vawter.omreporting.utility.DatabaseUpdate,Torque 
> exceptionIdGenerator for table 'tbl_Metric' is null
>
> The table use native autoincrement and from the snippets below 
> everything looks ok in db.
>
> Does anybody have a clue as to why I am getting this?
>
>
>
> Here is the DDL from MySQL
>
> CREATE TABLE `tbl_Metric` (
>  `metric_id` int(11) NOT NULL auto_increment,
>  `metric` varchar(50) NOT NULL default '',
>  PRIMARY KEY  (`metric_id`)
> ) TYPE=InnoDB
>
> So the table should autoincrement the key
>
> Here is the relevant snippet from the schema
>
>
> <database
>  name="omreporting"
>  defaultIdMethod="native"
>           package="com.vawter.omreporting.om" >
>
>                        <table name="tbl_Metric" description="Metrics" 
> idMethod="native">
>    <column
>      name="metric_id"
>      required="true"
>      primaryKey="true"
>      type="INTEGER"
> autoIncrement="true"
>      description="Metric Id"/>
>
>
> and here is a snippet from  TblMetricMapBuilder.java
>
>
>   public void doBuild() throws TorqueException
>    {
>        dbMap = Torque.getDatabaseMap("omreporting");
>
>        dbMap.addTable("tbl_Metric");
>        TableMap tMap = dbMap.getTable("tbl_Metric");
>
>        tMap.setPrimaryKeyMethod(TableMap.NATIVE);
>
>
>              tMap.addPrimaryKey("tbl_Metric.METRIC_ID", new Integer(0));
>                    tMap.addColumn("tbl_Metric.METRIC", new String());
>          }
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic