Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Working with multiple hbm files
[Teneo] Working with multiple hbm files [message #100007] Mon, 22 October 2007 14:51 Go to next message
Larry is currently offline LarryFriend
Messages: 26
Registered: July 2009
Junior Member
We use Configuration.addInputStream to add our hbm files to a Configuration.
Hibernate creates entries for each class in each hbm file and returns them
via Configuration.getMappedClasses. However, in
HbDataStore.computeReferrers, it appears that you require that all mapped
classes be resolvable in a single HbDataStore.

What's the recommended approach to working with multiple hbm files?

Thanks!

Larry
Re: [Teneo] Working with multiple hbm files [message #100033 is a reply to message #100007] Tue, 23 October 2007 08:11 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Larry,
I am not sure but I think what you mean is that the hbdatastore should be initialized from multiple
hbm files. Currently Teneo will search the classpath of the model java classes for files with the
name hibernate.hbm.xml. In addition one extra location (which can be set by an option) is searched.
So if there are multiple files it will find them. However because Teneo uses a fixed name
(hibernate.hbm.xml) it is not that flexible.
The only way to accomplish right now is to override HbSessionDataStore or HbEntityDataStore and
override the mapModel method and after delegating the call to the super class do your own:
getConfiguration().addInputStream(....).

You can enter a bugzilla for this so then I can think of a better solution which allows you to pass
multiple hbm files.

gr. Martin

Larry Stevens wrote:
> We use Configuration.addInputStream to add our hbm files to a Configuration.
> Hibernate creates entries for each class in each hbm file and returns them
> via Configuration.getMappedClasses. However, in
> HbDataStore.computeReferrers, it appears that you require that all mapped
> classes be resolvable in a single HbDataStore.
>
> What's the recommended approach to working with multiple hbm files?
>
> Thanks!
>
> Larry
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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] Working with multiple hbm files [message #100077 is a reply to message #100033] Tue, 23 October 2007 12:52 Go to previous messageGo to next message
Larry is currently offline LarryFriend
Messages: 26
Registered: July 2009
Junior Member
Martin

Both of our files are loading, but result in 2 hbdatastores. Perhaps that is
the problem.

Longer term it would be great to have an extension point for specifying hbm
files. Bugzilla is https://bugs.eclipse.org/bugs/show_bug.cgi?id=207155

Larry
"Martin Taal" <mtaal@elver.org> wrote in message
news:ffkabf$8cb$1@build.eclipse.org...
> Hi Larry,
> I am not sure but I think what you mean is that the hbdatastore should be
> initialized from multiple hbm files. Currently Teneo will search the
> classpath of the model java classes for files with the name
> hibernate.hbm.xml. In addition one extra location (which can be set by an
> option) is searched. So if there are multiple files it will find them.
> However because Teneo uses a fixed name (hibernate.hbm.xml) it is not that
> flexible.
> The only way to accomplish right now is to override HbSessionDataStore or
> HbEntityDataStore and override the mapModel method and after delegating
> the call to the super class do your own:
> getConfiguration().addInputStream(....).
>
> You can enter a bugzilla for this so then I can think of a better solution
> which allows you to pass multiple hbm files.
>
> gr. Martin
>
> Larry Stevens wrote:
>> We use Configuration.addInputStream to add our hbm files to a
>> Configuration. Hibernate creates entries for each class in each hbm file
>> and returns them via Configuration.getMappedClasses. However, in
>> HbDataStore.computeReferrers, it appears that you require that all mapped
>> classes be resolvable in a single HbDataStore.
>>
>> What's the recommended approach to working with multiple hbm files?
>>
>> Thanks!
>>
>> Larry
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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] Working with multiple hbm files [message #100128 is a reply to message #100077] Tue, 23 October 2007 21:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Larry,
I am not sure but what do you mean with: 'but result in 2 hbdatastores'?

gr. Martin

Larry Stevens wrote:
> Martin
>
> Both of our files are loading, but result in 2 hbdatastores. Perhaps that is
> the problem.
>
> Longer term it would be great to have an extension point for specifying hbm
> files. Bugzilla is https://bugs.eclipse.org/bugs/show_bug.cgi?id=207155
>
> Larry
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:ffkabf$8cb$1@build.eclipse.org...
>> Hi Larry,
>> I am not sure but I think what you mean is that the hbdatastore should be
>> initialized from multiple hbm files. Currently Teneo will search the
>> classpath of the model java classes for files with the name
>> hibernate.hbm.xml. In addition one extra location (which can be set by an
>> option) is searched. So if there are multiple files it will find them.
>> However because Teneo uses a fixed name (hibernate.hbm.xml) it is not that
>> flexible.
>> The only way to accomplish right now is to override HbSessionDataStore or
>> HbEntityDataStore and override the mapModel method and after delegating
>> the call to the super class do your own:
>> getConfiguration().addInputStream(....).
>>
>> You can enter a bugzilla for this so then I can think of a better solution
>> which allows you to pass multiple hbm files.
>>
>> gr. Martin
>>
>> Larry Stevens wrote:
>>> We use Configuration.addInputStream to add our hbm files to a
>>> Configuration. Hibernate creates entries for each class in each hbm file
>>> and returns them via Configuration.getMappedClasses. However, in
>>> HbDataStore.computeReferrers, it appears that you require that all mapped
>>> classes be resolvable in a single HbDataStore.
>>>
>>> What's the recommended approach to working with multiple hbm files?
>>>
>>> Thanks!
>>>
>>> Larry
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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] Working with multiple hbm files [message #100157 is a reply to message #100128] Wed, 24 October 2007 14:11 Go to previous message
Larry is currently offline LarryFriend
Messages: 26
Registered: July 2009
Junior Member
Martin

Each of our plugins can optionally define its own datastore (via an
extension point.) I'm beginning to think we need to merge them into a single
datastore (at least for relational persistence.)

Thanks

Larry

"Martin Taal" <mtaal@elver.org> wrote in message
news:fflnfl$nju$1@build.eclipse.org...
> Hi Larry,
> I am not sure but what do you mean with: 'but result in 2 hbdatastores'?
>
> gr. Martin
>
> Larry Stevens wrote:
>> Martin
>>
>> Both of our files are loading, but result in 2 hbdatastores. Perhaps that
>> is the problem.
>>
>> Longer term it would be great to have an extension point for specifying
>> hbm files. Bugzilla is
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=207155
>>
>> Larry
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:ffkabf$8cb$1@build.eclipse.org...
>>> Hi Larry,
>>> I am not sure but I think what you mean is that the hbdatastore should
>>> be initialized from multiple hbm files. Currently Teneo will search the
>>> classpath of the model java classes for files with the name
>>> hibernate.hbm.xml. In addition one extra location (which can be set by
>>> an option) is searched. So if there are multiple files it will find
>>> them. However because Teneo uses a fixed name (hibernate.hbm.xml) it is
>>> not that flexible.
>>> The only way to accomplish right now is to override HbSessionDataStore
>>> or HbEntityDataStore and override the mapModel method and after
>>> delegating the call to the super class do your own:
>>> getConfiguration().addInputStream(....).
>>>
>>> You can enter a bugzilla for this so then I can think of a better
>>> solution which allows you to pass multiple hbm files.
>>>
>>> gr. Martin
>>>
>>> Larry Stevens wrote:
>>>> We use Configuration.addInputStream to add our hbm files to a
>>>> Configuration. Hibernate creates entries for each class in each hbm
>>>> file and returns them via Configuration.getMappedClasses. However, in
>>>> HbDataStore.computeReferrers, it appears that you require that all
>>>> mapped classes be resolvable in a single HbDataStore.
>>>>
>>>> What's the recommended approach to working with multiple hbm files?
>>>>
>>>> Thanks!
>>>>
>>>> Larry
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> 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
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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] Working with multiple hbm files [message #610123 is a reply to message #100007] Tue, 23 October 2007 08:11 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Larry,
I am not sure but I think what you mean is that the hbdatastore should be initialized from multiple
hbm files. Currently Teneo will search the classpath of the model java classes for files with the
name hibernate.hbm.xml. In addition one extra location (which can be set by an option) is searched.
So if there are multiple files it will find them. However because Teneo uses a fixed name
(hibernate.hbm.xml) it is not that flexible.
The only way to accomplish right now is to override HbSessionDataStore or HbEntityDataStore and
override the mapModel method and after delegating the call to the super class do your own:
getConfiguration().addInputStream(....).

You can enter a bugzilla for this so then I can think of a better solution which allows you to pass
multiple hbm files.

gr. Martin

Larry Stevens wrote:
> We use Configuration.addInputStream to add our hbm files to a Configuration.
> Hibernate creates entries for each class in each hbm file and returns them
> via Configuration.getMappedClasses. However, in
> HbDataStore.computeReferrers, it appears that you require that all mapped
> classes be resolvable in a single HbDataStore.
>
> What's the recommended approach to working with multiple hbm files?
>
> Thanks!
>
> Larry
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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] Working with multiple hbm files [message #610130 is a reply to message #100033] Tue, 23 October 2007 12:52 Go to previous message
Larry is currently offline LarryFriend
Messages: 26
Registered: July 2009
Junior Member
Martin

Both of our files are loading, but result in 2 hbdatastores. Perhaps that is
the problem.

Longer term it would be great to have an extension point for specifying hbm
files. Bugzilla is https://bugs.eclipse.org/bugs/show_bug.cgi?id=207155

Larry
"Martin Taal" <mtaal@elver.org> wrote in message
news:ffkabf$8cb$1@build.eclipse.org...
> Hi Larry,
> I am not sure but I think what you mean is that the hbdatastore should be
> initialized from multiple hbm files. Currently Teneo will search the
> classpath of the model java classes for files with the name
> hibernate.hbm.xml. In addition one extra location (which can be set by an
> option) is searched. So if there are multiple files it will find them.
> However because Teneo uses a fixed name (hibernate.hbm.xml) it is not that
> flexible.
> The only way to accomplish right now is to override HbSessionDataStore or
> HbEntityDataStore and override the mapModel method and after delegating
> the call to the super class do your own:
> getConfiguration().addInputStream(....).
>
> You can enter a bugzilla for this so then I can think of a better solution
> which allows you to pass multiple hbm files.
>
> gr. Martin
>
> Larry Stevens wrote:
>> We use Configuration.addInputStream to add our hbm files to a
>> Configuration. Hibernate creates entries for each class in each hbm file
>> and returns them via Configuration.getMappedClasses. However, in
>> HbDataStore.computeReferrers, it appears that you require that all mapped
>> classes be resolvable in a single HbDataStore.
>>
>> What's the recommended approach to working with multiple hbm files?
>>
>> Thanks!
>>
>> Larry
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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] Working with multiple hbm files [message #610137 is a reply to message #100077] Tue, 23 October 2007 21:01 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Larry,
I am not sure but what do you mean with: 'but result in 2 hbdatastores'?

gr. Martin

Larry Stevens wrote:
> Martin
>
> Both of our files are loading, but result in 2 hbdatastores. Perhaps that is
> the problem.
>
> Longer term it would be great to have an extension point for specifying hbm
> files. Bugzilla is https://bugs.eclipse.org/bugs/show_bug.cgi?id=207155
>
> Larry
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:ffkabf$8cb$1@build.eclipse.org...
>> Hi Larry,
>> I am not sure but I think what you mean is that the hbdatastore should be
>> initialized from multiple hbm files. Currently Teneo will search the
>> classpath of the model java classes for files with the name
>> hibernate.hbm.xml. In addition one extra location (which can be set by an
>> option) is searched. So if there are multiple files it will find them.
>> However because Teneo uses a fixed name (hibernate.hbm.xml) it is not that
>> flexible.
>> The only way to accomplish right now is to override HbSessionDataStore or
>> HbEntityDataStore and override the mapModel method and after delegating
>> the call to the super class do your own:
>> getConfiguration().addInputStream(....).
>>
>> You can enter a bugzilla for this so then I can think of a better solution
>> which allows you to pass multiple hbm files.
>>
>> gr. Martin
>>
>> Larry Stevens wrote:
>>> We use Configuration.addInputStream to add our hbm files to a
>>> Configuration. Hibernate creates entries for each class in each hbm file
>>> and returns them via Configuration.getMappedClasses. However, in
>>> HbDataStore.computeReferrers, it appears that you require that all mapped
>>> classes be resolvable in a single HbDataStore.
>>>
>>> What's the recommended approach to working with multiple hbm files?
>>>
>>> Thanks!
>>>
>>> Larry
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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] Working with multiple hbm files [message #610143 is a reply to message #100128] Wed, 24 October 2007 14:11 Go to previous message
Larry is currently offline LarryFriend
Messages: 26
Registered: July 2009
Junior Member
Martin

Each of our plugins can optionally define its own datastore (via an
extension point.) I'm beginning to think we need to merge them into a single
datastore (at least for relational persistence.)

Thanks

Larry

"Martin Taal" <mtaal@elver.org> wrote in message
news:fflnfl$nju$1@build.eclipse.org...
> Hi Larry,
> I am not sure but what do you mean with: 'but result in 2 hbdatastores'?
>
> gr. Martin
>
> Larry Stevens wrote:
>> Martin
>>
>> Both of our files are loading, but result in 2 hbdatastores. Perhaps that
>> is the problem.
>>
>> Longer term it would be great to have an extension point for specifying
>> hbm files. Bugzilla is
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=207155
>>
>> Larry
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:ffkabf$8cb$1@build.eclipse.org...
>>> Hi Larry,
>>> I am not sure but I think what you mean is that the hbdatastore should
>>> be initialized from multiple hbm files. Currently Teneo will search the
>>> classpath of the model java classes for files with the name
>>> hibernate.hbm.xml. In addition one extra location (which can be set by
>>> an option) is searched. So if there are multiple files it will find
>>> them. However because Teneo uses a fixed name (hibernate.hbm.xml) it is
>>> not that flexible.
>>> The only way to accomplish right now is to override HbSessionDataStore
>>> or HbEntityDataStore and override the mapModel method and after
>>> delegating the call to the super class do your own:
>>> getConfiguration().addInputStream(....).
>>>
>>> You can enter a bugzilla for this so then I can think of a better
>>> solution which allows you to pass multiple hbm files.
>>>
>>> gr. Martin
>>>
>>> Larry Stevens wrote:
>>>> We use Configuration.addInputStream to add our hbm files to a
>>>> Configuration. Hibernate creates entries for each class in each hbm
>>>> file and returns them via Configuration.getMappedClasses. However, in
>>>> HbDataStore.computeReferrers, it appears that you require that all
>>>> mapped classes be resolvable in a single HbDataStore.
>>>>
>>>> What's the recommended approach to working with multiple hbm files?
>>>>
>>>> Thanks!
>>>>
>>>> Larry
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> 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
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> 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:[Announce] Mint component proposal
Next Topic:[Teneo] - Union Subclass out of memory
Goto Forum:
  


Current Time: Thu Apr 25 08:12:14 GMT 2024

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

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

Back to the top