[JBoss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Automatic generation of primary key
Thank you for your reply. I've tried your solution using entity-command name=mysql-get-generated-keys/entity-command and autoincrement/ Unfortunatly, it doesn't solve my problem (I still get a null primary key). Did you do something else in order to find this class?(maybe adding a jar or a reference to a jar)? Thank you again View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3948631#3948631 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3948631 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Automatic generation of primary key
I don't know what it could be then :(. As far as i understand, general idea of pk generation is to tell EJB engine what type (class) of pk it will be, and tell details to jboss personally. Something about integer type should be mentioned in ejb-jar.xml and particular instructions in jbosscmp-jdbc.xml How your ejbCreate and ejbPostCreate looks like? It should not contain pk field in signature and no calls to pk inside i mean nothing of getId() (could be not assigned yet) and setId(id) will override autoincremented value. That is just my current understanding, it works for me. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3948702#3948702 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3948702 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Automatic generation of primary key
Thank you for your answer. It was the way I found. I use entity-command name=key-generator | class=org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCKeyGeneratorCreateCommand | attribute name=key-generator-factory | HiLoKeyGeneratorFactory | /attribute | | /entity-command Unfortunatly, I get a ClassCastException because it generates a Long and I need an Integer. Do you now the name of an appropriate factory? Thank you View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3948306#3948306 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3948306 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Automatic generation of primary key
Look for auto-increment and entity-command. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3948201#3948201 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3948201 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user