|
|
|
Re: [TENEO] IdentifierGenerator [message #425388 is a reply to message #425380] |
Mon, 24 November 2008 05:21 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Ha ha, thanks, :-),
gr. Martin
Liviu wrote:
> Yep, that hit the spot - its all answered and crystal clear.
>
> I could just say thanks, but then again sounds better: You The Man.
> Like Tyrell and Lorenzo all rolled into one.
> Check this out - googled it specially for you:
> http://www.theonion.com/content/node/34216
>
> Liviu
> Martin Taal wrote:
>> Hi Liviu,
>> Yes the strategy attribute should have the class name of your
>> IdentifierGenerator.
>>
>> The IdentifierGenerator.generate method has a session and a object
>> parameter. The object is the entity which gets persisted. You can cast
>> this object to EObject and ask for the eclass and use the eclass name
>> and epackage or use the classname.
>>
>> Looking at the Hibernate source code I think it can make sense to
>> implement your own TableHiLoGenerator which combines the logic from the
>> TableHiLoGenerator and TableGenerator and uses the class/eclass as an
>> additional parameter in the sql queries.
>>
>> gr. Martin
>>
>> Liviu wrote:
>>> Hello,
>>>
>>> This is somewhat related to my earlier post (IPersistable interface with
>>> a myid property that could get implemented by all entities in the model)
>>>
>>> I tried to dig a little more and here is my "second" question reloaded:
>>>
>>> 1. Could I use the strategy property of the GenericGenerator to indicate
>>> the use of a custom IdentifierGenerator ?
>>>
>>> 2. Could this custom IdentifierGenerator extend the TableHiLoGenerator?
>>>
>>> 3. Is there any way I could inject the name of the entity being
>>> persisted into this custom TableHiLoGenerator? Note that the adnotation
>>> will be made on the IPersistable interface.
>>>
>>> Please see my earlier post for the spadcore.ecore attachment.
>>>
>>> Thanks a lot for your patience
>>> Liviu
>>
--
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
|
|
|
Powered by
FUDForum. Page generated in 0.02120 seconds