Re: [JBoss-user] automatic primary key generation for CMP entityBeans?

2003-12-13 Thread Alexey Loubyansky
[EMAIL PROTECTED] wrote: The generator I have in mind will increment the values. Where do you plan to store the values? Database? In the interfaces, I cant see some init(startValue) method or something similar. This method should be there and should be called on initializing the generator.

Re: [JBoss-user] automatic primary key generation for CMP entityBeans?

2003-12-12 Thread stscit04
I have seen the UUIDKeyGeneratorFactory, where can I find information about how to write my own factory ? I also need to know how to use entity-commands/how to use the default keygenerator. Thanks in advance, Stefan select max() is not safe. Look at standardjbosscmp-jdbc.xml file for

Re: [JBoss-user] automatic primary key generation for CMP entityBeans?

2003-12-12 Thread Alexey Loubyansky
[EMAIL PROTECTED] wrote: I have seen the UUIDKeyGeneratorFactory, where can I find information about how to write my own factory ? You need to implement two interfaces: org.jboss.ejb.plugins.keygenerator.KeyGeneratorFactory and org.jboss.ejb.plugins.keygenerator.KeyGenerator. Check the

Re: [JBoss-user] automatic primary key generation for CMP entityBeans?

2003-12-12 Thread stscit04
I have seen the UUIDKeyGeneratorFactory, where can I find information about how to write my own factory ? You need to implement two interfaces: org.jboss.ejb.plugins.keygenerator.KeyGeneratorFactory and org.jboss.ejb.plugins.keygenerator.KeyGenerator. Check the

Re: [JBoss-user] automatic primary key generation for CMP entityBeans?

2003-12-12 Thread stscit04
I have seen the UUIDKeyGeneratorFactory, where can I find information about how to write my own factory ? You need to implement two interfaces: org.jboss.ejb.plugins.keygenerator.KeyGeneratorFactory and org.jboss.ejb.plugins.keygenerator.KeyGenerator. Check the

[JBoss-user] automatic primary key generation for CMP entityBeans ?

2003-12-11 Thread stscit04
Hello, everyone I have a Entity Bean with a String as PK. The String consists of the characters [0-9]and[A-Z]. My approach is to get the latest key from the DB with an ejbSelect method(select MAX()). Is this safe, or is it possible that I assign accidentially the same PK to 2 entitys because

Re: [JBoss-user] automatic primary key generation for CMP entityBeans ?

2003-12-11 Thread Alexey Loubyansky
select max() is not safe. Look at standardjbosscmp-jdbc.xml file for entity-commands for avaliable key generations. [EMAIL PROTECTED] wrote: Hello, everyone I have a Entity Bean with a String as PK. The String consists of the characters [0-9]and[A-Z]. My approach is to get the latest key from