The spec currently does not define support for UUID generator. One
workaround is to generate and assign an UUID using** java.util.UUID** to
your id field in constructor of your pojo.
Regards,
Mitesh
Farrukh S. Najmi wrote:
> Farrukh S. Najmi wrote:
>
>> Dear colleagues,
>>
>> In my application that uses Java Persistence (and does not use EJBs), I
>> would like to specify a custom id generator similar to
>> org.hibernate.id.UUIDHexGenerator. It is not clear from reading the spec
>> how this can be accomplished. Thanks for any pointers you can provide.
>>
>>
>>
> To be clearer....
>
> What I would like to do is to specify a GeneratedValue annotion on an
> @id field in my entity class such that
> a strategy can be specified that uses a custom id generator class (e.g.
> a UUID generator class). What is the
> best way to accomplish this? Thanks.
>
>