Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] @SequenceGenerator initialValue oneclipselink.ddl-generation is ignored

Hi,

Thanks 4 the response, but maybe my question is not clear.
btw, the sequence is not already exist on the database.

I want eclipselink.ddl-generation to generate sequence for me starting
with value *10000*.
I'm using this annotation to do that:
@SequenceGenerator(name="RoleSeq",sequenceName="seq_role",initialValue=10000)

But, the generated sequence is start with 50:
CREATE SEQUENCE seq_role
INCREMENT 50
MINVALUE 1
MAXVALUE 9223372036854775807
START **50**
CACHE 1;

instead of start with 10000 (I expect 10000 because I've use
initialValue=10000 on my annotation)
CREATE SEQUENCE seq_role
INCREMENT 50
MINVALUE 1
MAXVALUE 9223372036854775807
START **10000**
CACHE 1;

Is this an eclipselink bug? or is this my fault to not understand what
"initialValue" means ?
Plz help..

Thanks..



On Fri, Apr 30, 2010 at 8:14 PM, Andrei Ilitchev
<andrei.ilitchev@xxxxxxxxxx> wrote:
> May be the sequence with start 50 already exists in the db?
> Either drop the sequence from the db "by hand", or alternatively use
> "drop-and-create-tables" instead of "create-tables"
> ----- Original Message ----- From: "Yohan Yudanara"
>
>> Hi..
>>
>> I'm using JPA 2.0 on Glassfish v3.0.
>> I'm running Postgresql 8.4 and postgresql-8.4-701.jdbc4 JDBC Driver on
>> JDK 6 and Vista.
>>
>> I've found a problem that might be a bug.
>> When I'm using initialValue on @SequenceGenerator annotation and use
>> eclipselink.ddl-generation (create-tables) on persistence.xml, the
>> generated sequence always ignore the initialValue attribute.
>>
>> This is my annotation:
>>
>> @SequenceGenerator(name="RoleSeq",sequenceName="seq_role",initialValue=10000)
>> @Id @GeneratedValue(generator="RoleSeq")
>> @Column(name="id")
>> private Long id;
>>
>> And this is the generated sequence: (start value is always 50, not 10000)
>> CREATE SEQUENCE seq_role
>>  INCREMENT 50
>>  MINVALUE 1
>>  MAXVALUE 9223372036854775807
>>  START 50
>>  CACHE 1;
>>
>> Does anyone experience this problem?
>> Should I report this as a bug?
>>
>> Thanks...


Back to the top