db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Moiseyev <ser...@peoplelogic.com.au>
Subject Using native id method for MySQL
Date Thu, 23 Oct 2003 02:10:49 GMT
Hello

I have problem inserting data in to the tables when using database
attribute

defautIdMethod = "native".

I am using torque-3.0.
I have no probs when using idbroker. When I change it to native, rebuild
and run the pogram I get the following exception:

org.apache.torque.TorqueException: IdGenerator for table 'frm_category'
is null
    at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:690)
    at
com.peoplelogic.db.BaseFrmCategoryPeer.doInsert(BaseFrmCategoryPeer.java:216)
    at
com.peoplelogic.db.BaseFrmCategoryPeer.doInsert(BaseFrmCategoryPeer.java:565)
    at com.peoplelogic.db.BaseFrmCategory.save(BaseFrmCategory.java:508)
    at com.peoplelogic.db.BaseFrmCategory.save(BaseFrmCategory.java:470)
    at com.peoplelogic.db.BaseFrmCategory.save(BaseFrmCategory.java:450)
    at
com.peoplelogic.test.TorqueTest.createFormCategories(TorqueTest.java:59)
    at com.peoplelogic.test.TorqueTest.main(TorqueTest.java:43)

All the tables created OK with autoincrement primary keys
This is my property file:

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

torque.database.default = sergey
torque.database.sergey.adapter = mysql
torque.database.sergey.driver = org.gjt.mm.mysql.Driver
torque.database.sergey.url = jdbc:mysql://192.168.1.3/sergey
torque.database.sergey.username = systems
torque.database.sergey.password =  tunafish

Note, thate I have set

torque.database.sergey.adapter=mysql

but I can't find corresponding adapter in the adapter package! Could it
be the problem?

Could anyone help me to understand whats going on? And what is the
advantages of using native instad of idbroker. And if I use native do I
still need the ID_TABLE?

Thanks,

Sergey


---------------------------------------------------------------------
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


Mime
View raw message