[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting generated ID by sequence

2007-09-13 Thread rjstanford
I'm having a similar problem - using MySQL as the backend (not that I think it matters) and just the default @GeneratedValue option. I've seen references in other sites that imply that if you use a generated value, the Id will be updated as soon as you call persist(). In our case, before

[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting generated ID by sequence

2007-03-12 Thread stupar.aleksandar
andydale wrote : Hi, | | Try declaring your sdequence as so: | @SequenceGenerator(name = tsperson_sequence, allocationSize=1, sequenceName = SEQ_TSPERSON_ID) | You must have the allocationSize=1 (or some other value) or it uses some kind of hi-lo strategy. | | Cheers, | | Andy

[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting generated ID by sequence

2007-03-05 Thread rabbiaqaswar
try: | @Entity | public class Tsperson implements Serializable { | @Id | @Column(name=TSPERSON_ID, nullable = false) | @SequenceGenerator(name = tsperson_sequence, sequenceName = SEQ_TSPERSON_ID) | @GeneratedValue(strategy=GenerationType.SEQUENCE, generator=tsperson_sequence) |

[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting generated ID by sequence

2007-03-05 Thread andydale
Hi, Try declaring your sdequence as so: @SequenceGenerator(name = tsperson_sequence, allocationSize=1, sequenceName = SEQ_TSPERSON_ID) You must have the allocationSize=1 (or some other value) or it uses some kind of hi-lo strategy. Cheers, Andy View the original post :