|
|
|
Re: [TENEO] name/class registered for hibernate metadata changes depending on data store init approa [message #430938 is a reply to message #430937] |
Thu, 18 June 2009 14:14 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
So to be sure. Can you debug into the code. The part which determines this: EntityMapper.createEntity, there is an
if-else statement with three parts:
if (entity.isOnlyMapAsEntity()) {
// sets entity-name only
} else if (getHbmContext().forceUseOfInstance(entity)) {
// sets only name
} else {
// sets both entity-name and name
}
where getHbmContext().forceUseOfInstance(entity) is always false afaics, so afaics entity-name should always be set.
gr. Martin
aappddeevv wrote:
>
> The only thing that I can see is that the attribute entity-name is set
> and when that is set, that is what is needed to access the class inside
> of hibernate. Since its not the FQN, I have to use just the class name.
>
> Is that a recent generator change or perhaps something I set in my model
> but did not know it?
>
> I can't get my non-spring test working due to bundle conflicts at the
> moment. I know you use the same generator underneath. I ran my previous
> test 3-4 weeks ago so if its a recent change, that would explain it.
>
>
> Martin Taal wrote:
>> Hi Apdev,
>> Yes this is not correct. Can you check the mapping xml? Is it
>> different for both cases?
>> What is the content of the EPackageClasses argument?
>>
>> gr. Martin
>>
>> aappddeevv wrote:
>>> I had a test program that ran the HbSessionDataStore and initialized
>>> it using setEPackages(list of packages instances).
>>>
>>> Now I am using spring and follow the instructions that suggest using
>>> the EPackageClasses argument which is a list of strings.
>>>
>>> When I used the programming way, it allows me to get my domain
>>> objects using
>>> getSession().createCriteria(MyClassInterface.class).list().
>>>
>>> However, when I initialize using the spring way I have to
>>> getSession().createCriteria("MyClassInterface").list() which requires
>>> a non-FQN string name.
>>>
>>> The code paths appear different. Is this intended? If so, I would say
>>> this is a bug because I have to change my usage of hibernate based on
>>> how I initialized the HbSessionDataStore object.
>>
>>
--
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.03458 seconds