Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Sequence in Postgresql

Hi, 
      as far as I know, there is not much difference in the way Sequences work in postgresql and Oracle; and hence eclipselink works the same way on both the  
      database systems.

Regards,
Samba

On Sun, Feb 7, 2010 at 2:34 PM, Tan-Vinh Nguyen <cinhtau@xxxxxxxxxxxxxx> wrote:
Hello everybody,

I'm a great fan of Postgresql. I started to evaluate the use of
EclipseLink with Postgresql. I read at following introduction

http://wiki.eclipse.org/Introduction_to_EclipseLink_JPA_%28ELUG%29#.40GeneratedValue

that

"SEQUENCE – specify that EclipseLink persistence provider use a database
sequence (see @SequenceGenerator).

Note:SEQUENCE strategy is only supported on Oracle Database."

I was curious so I tried it with Postgresql Sequences and it works
perfectly.

@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PARTNER_SEQ")
@SequenceGenerator(name="PARTNER_SEQ", sequenceName="partners_id_seq",
allocationSize=1)
private Long id;

I'm wrong or is this introduction out of date and needs an update? Any
comments for clarification are appreciated.

Thanks in advance.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top