Skip to main content

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

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.


Back to the top