Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [TENEO] name/class registered for hibernate metadata changes depending on data store init approach
[TENEO] name/class registered for hibernate metadata changes depending on data store init approach [message #430922] Wed, 17 June 2009 19:41 Go to next message
No real name is currently offline No real nameFriend
Messages: 113
Registered: July 2009
Senior Member
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.
Re: [TENEO] name/class registered for hibernate metadata changes depending on data store init approa [message #430924 is a reply to message #430922] Wed, 17 June 2009 21:13 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
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
Re: [TENEO] name/class registered for hibernate metadata changes depending on data store init approa [message #430937 is a reply to message #430924] Thu, 18 June 2009 12:38 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 113
Registered: July 2009
Senior Member
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.
>
>
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 Go to previous message
Martin Taal is currently offline Martin TaalFriend
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
Previous Topic:Default values for elements of simple types
Next Topic:Template Plugin Variables
Goto Forum:
  


Current Time: Fri Apr 26 13:53:03 GMT 2024

Powered by FUDForum. Page generated in 0.03458 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top