Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Sequence generator problem with Derby,

Hello.

I Have this entity:

@Entity
@Table(name = "Productos")
public class Producto{
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="productos_seq" )
@SequenceGenerator(name="productos_seq", sequenceName="PRODUCTOS_SEQ", initialValue=1, allocationSize=1)
private Integer id;
...Omit

The database is created with eclipselink DDL-create using Derby DB 10.10.1.1.

If I insert 3 objects I obtain IDs:

1
2
3

but if I restart the app, the next time I insert three objects I obtain:
101
102
103

Instead of the expected:
4
5
6

Is this a bug?
or is working correctly?

Thanks for your time.

Back to the top