users@jpa-spec.java.net

[jpa-spec users] Re: Custom Sequence Generation

From: Andrew Ward <andreww100_at_gmail.com>
Date: Tue, 20 Mar 2012 23:10:28 +0000

Hi

Are there any plans to standardise the API to register a custom sequence generator?

I can't find a reference in draft 6 that explains how custom sequences are registered with the JPA provider, and the EclipseLink code below uses a proprietary API.

It would be great if there was a portable sequence/id generator Interface.

Thanks
Andrew

Ps: thanks for responding to my Enum question Mike.

On 27 Dec 2011, at 21:20, Andrew Ward <andreww100_at_gmail.com> wrote:

> Hi Expert Group
>
> Are there plans to standardise the mechanism of building custom sequence generators? I could not find any sequence generator enhancements in Early Draft 5.
>
> Existing tools provide proprietary extensions to accomplish this.
>
> EclipseLink has org.eclipse.persistence.sequencing.Sequence
> http://wiki.eclipse.org/EclipseLink/Examples/JPA/CustomSequencing
>
> Hibernate has org.hibernate.id.SequenceGenerator
> http://www.georgestragand.com/jpaseq.html
>
> For example, you can imagine people wanting to build sequences that include check digits, or custom formatting.
>
> Many thanks
>
> Andrew Ward