|
Re: [Texo] Best way to add JPA implementor specific annotation to generated entities [message #799914 is a reply to message #799749] |
Thu, 16 February 2012 13:12 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Benoit,
Yes generatedNot indeed. Or afaik hibernate allows you to add extra mappings through the orm.xml. So in this case let
Texo generate the code as in your first example and then add the GenericGenerator using a separate manual orm.xml. The
hibernate docs can tell you more if this is possible (I believe so).
gr. Martin
On 02/16/2012 10:14 AM, Benoit Cantin wrote:
> Hi all,
>
> I need to add Hibernate specific content to the code of the generated entities.
>
> With Texo, to customize the id generation, I can get :
>
>
> @Id()
> @GeneratedValue(generator = "CustomIdGenerator", strategy = GenerationType.AUTO)
> private Long id = null;
>
>
> What I want is :
>
>
> @Id()
> @GeneratedValue(generator = "CustomIdGenerator", strategy = GenerationType.AUTO)
> @GenericGenerator(name = "CustomIdGenerator", strategy = "com.my.company.entities.CustomIdGenerator")
> private Long id = null;
>
>
> (GenericGenerator being Hibernate specific)
>
> What is the best solution to achieve this ? Do I have to use @generatedNOT on my property called id ?
>
> Thank you.
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Texo] Best way to add JPA implementor specific annotation to generated entities [message #799930 is a reply to message #799914] |
Thu, 16 February 2012 13:26 |
Benoit Cantin Messages: 34 Registered: January 2012 |
Member |
|
|
On 02/16/2012 02:12 PM, Martin Taal wrote:
> Hi Benoit,
> Yes generatedNot indeed. Or afaik hibernate allows you to add extra
> mappings through the orm.xml. So in this case let Texo generate the code
> as in your first example and then add the GenericGenerator using a
> separate manual orm.xml. The hibernate docs can tell you more if this is
> possible (I believe so).
Thank you Martin. generatedNOT, will be set on a part of the code that
won't change much in the near future. So I am going to use it here.
--
Benoit
>
> gr. Martin
>
> On 02/16/2012 10:14 AM, Benoit Cantin wrote:
>> Hi all,
>>
>> I need to add Hibernate specific content to the code of the generated
>> entities.
>>
>> With Texo, to customize the id generation, I can get :
>>
>>
>> @Id()
>> @GeneratedValue(generator = "CustomIdGenerator", strategy =
>> GenerationType.AUTO)
>> private Long id = null;
>>
>>
>> What I want is :
>>
>>
>> @Id()
>> @GeneratedValue(generator = "CustomIdGenerator", strategy =
>> GenerationType.AUTO)
>> @GenericGenerator(name = "CustomIdGenerator", strategy =
>> "com.my.company.entities.CustomIdGenerator")
>> private Long id = null;
>>
>>
>> (GenericGenerator being Hibernate specific)
>>
>> What is the best solution to achieve this ? Do I have to use
>> @generatedNOT on my property called id ?
>>
>> Thank you.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02893 seconds