db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Vawter <...@vawter.com>
Subject IdGenerator is null
Date Fri, 29 Oct 2004 19:18:45 GMT

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


Mime
View raw message