(I removed some tables becuase otherwise it is very big, but currently I am using in my app only these two...)
<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database_3_1.dtd">
<!-- Autogenerated by JDBCToXMLSchema! -->
<database defaultIdMethod="native">
<table name="address_book">
<column name="address_book_id" primaryKey="true" required="true" type="INTEGER"/>
<column default="0" name="customers_id" required="true" type="INTEGER"/>
<column default="" name="entry_gender" required="true" size="1" type="CHAR"/>
<column name="entry_company" size="32" type="VARCHAR"/>
<column default="" name="entry_firstname" required="true"
size="32" type="VARCHAR"/>
<column default="" name="entry_lastname" required="true"
size="32" type="VARCHAR"/>
<column default="" name="entry_street_address" required="true"
size="64" type="VARCHAR"/>
<column name="entry_suburb" size="32" type="VARCHAR"/>
<column default="" name="entry_postcode" required="true"
size="10" type="VARCHAR"/>
<column default="" name="entry_city" required="true" size="32" type="VARCHAR"/>
<column name="entry_state" size="32" type="VARCHAR"/>
<column default="0" name="entry_country_id" required="true" type="INTEGER"/>
<column default="0" name="entry_zone_id" required="true" type="INTEGER"/>
</table>
<table name="customers">
<column name="customers_id" primaryKey="true" required="true" type="INTEGER"/>
<column default="" name="customers_nick" required="true"
size="16" type="VARCHAR"/>
<column default="" name="customers_gender" required="true"
size="1" type="CHAR"/>
<column default="" name="customers_firstname" required="true"
size="32" type="VARCHAR"/>
<column default="" name="customers_lastname" required="true"
size="32" type="VARCHAR"/>
<column default="" name="customers_dob"
required="true" type="TIMESTAMP"/>
<column default="" name="customers_email_address"
required="true" size="96" type="VARCHAR"/>
<column default="0" name="customers_default_address_id"
required="true" type="INTEGER"/>
<column default="" name="customers_telephone" required="true"
size="32" type="VARCHAR"/>
<column name="customers_fax" size="32" type="VARCHAR"/>
<column default="" name="customers_password" required="true"
size="40" type="VARCHAR"/>
<column name="customers_newsletter" size="1" type="CHAR"/>
<column default="0" name="registered_ip" required="true" type="INTEGER"/>
<column default="" name="registered_host" required="true"
size="128" type="VARCHAR"/>
<column default="" name="registered_on"
required="true" type="TIMESTAMP"/>
<column name="registration_code" size="32" type="VARCHAR"/>
<column name="last_change_ip" type="INTEGER"/>
<column name="last_change_host" size="128" type="VARCHAR"/>
<column name="last_changed_on" type="TIMESTAMP"/>
</table>
</database>
And the torque properties (I removed some commented lines) =========================================================================== # ------------------------------------------------------------------- # $Id: Torque.properties,v 1.11 2003/08/19 19:09:44 mpoeschl Exp $ # # This is the configuration file for Torque. # # Note that strings containing "," (comma) characters must backslash # escape the comma (i.e. '\,') # # -------------------------------------------------------------------
torque.applicationRoot = .
# ------------------------------------------------------------------- # # L O G G I N G # # ------------------------------------------------------------------- # We use Log4J for all Torque logging and we embed the log4j # properties within our application configuration. # -------------------------------------------------------------------
# This first category is required and the category # must be named 'default'. This is used for all logging # where an explicit category is not specified.
log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = ${torque.applicationRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.org.apache.torque.append = false
# ------------------------------------------------------------------- # # T O R Q U E P R O P E R T I E S # # ------------------------------------------------------------------- # These are your database settings. Look in the # org.apache.torque.pool.* packages for more information. # # The parameters to connect to the default database. You MUST # configure these properly. # -------------------------------------------------------------------
torque.database.default=tutim torque.database.tutim.adapter=mysql
## Using jndi
torque.dsfactory.tutim.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
torque.dsfactory.tutim.jndi.path=java:comp/env/jdbc/tutim
torque.dsfactory.tutim.jndi.java.naming.factory.initial = org.apache.naming.java.javaURLContextFactory
torque.dsfactory.tutim.jndi.java.naming.factory.url.pkgs = org.apache.naming
# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a high
# volume.
torque.idbroker.cleverquantity=true
# Determines whether the managers cache instances of the business objects. # And also whether the MethodResultCache will really cache results.
torque.manager.useCache = true
=========================================================================
Andras Balogh wrote:
Hello,
I don't think you need his table. Can you post the schema file and torque.properties (of course you should
alter connection info to something dummy)?
Andras.
ron piterman wrote:
Well, I added the table, but I still get the exception :(
org.apache.torque.TorqueException: IdGenerator for table 'customers' is null
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:708)
at tutim.db.DBCustomersPeer.doInsert(DBCustomersPeer.java:258)
at tutim.db.DBCustomersPeer.doInsert(DBCustomersPeer.java:636)
at tutim.db.DBCustomers.save(DBCustomers.java:993)
...
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]