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