tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Hibernate IdentifierGenerator
Date Sun, 06 Jul 2014 15:14:30 GMT
Hi

just guessing but openjpa uuid strategy can match your need:
http://ci.apache.org/projects/openjpa/trunk/docbook/manual.html#jpa_overview_meta_gen

in all cases you can define your own Generator
http://ci.apache.org/projects/openjpa/trunk/javadoc/org/apache/openjpa/persistence/Generator.html



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-07-06 15:09 GMT+02:00 agumbrecht <agumbrecht@tomitribe.com>:
> Hi Herau,
>
> Try this as a generic solution:
>
> @Id
> @GeneratedValue(generator = "uuid")
> @GenericGenerator(name = "uuid", strategy = "uuid")
> @Column(name = "id", unique = true)
> private String id;
>
> I'm not so sure that OpenJPA supports custom generators out of the box, so I
> will need to look into that.
>
> You can still use Hibernate in TomEE, so no need to change your app if you
> want to stick with Hibernate.
>
> See the example here: http://openejb.apache.org/examples/jpa-hibernate/
>
> Andy.
>
>
>
>
> -----
>     --
>     Andy Gumbrecht
>
>     http://www.tomitribe.com
>     agumbrecht@tomitribe.com
>     https://twitter.com/AndyGeeDe
>
>     TomEE treibt Tomitribe ! | http://tomee.apache.org
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Hibernate-IdentifierGenerator-tp4670255p4670336.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message