Mitesh Meswani wrote:
> 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.
IMHO the spec RFE is not to "define support for UUID generator" but to
define support for arbitrary id generator classes. This is what
Hibernate currently supports. Often there are app specific contraints on
id generation so there needs to be flexibility allowing id generator to
be specified by the application and not simply the persistence provider.
Thanks.
>
> 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.
>>
>>
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com