Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » HibernateConfiguration not accessable
HibernateConfiguration not accessable [message #116317] Fri, 28 March 2008 14:58 Go to next message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hi Martin,

I like to manipulate the Hibernate configuration programmatically. I want
to install an own event listener.

Now I've found that the HbDataStore.getHibernateConfiguration() is
protected. Since I get the HbDataStore from the HbHelper and by this way
from a factory I don't know (and don't want to know) the implementation
class. Is there a reason for making the getHibernateConfiguration() method
protected?

Or is there another way to configure my listener? Since the listener
implements three interfaces a hibernate xml configuration file does not
work.

Regards
Manfred

Ps. Sorry for having so many questions today!
Re: HibernateConfiguration not accessable [message #116322 is a reply to message #116317] Fri, 28 March 2008 15:39 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Manfred,
Many questions are no problem, they help to improve the solution.

Currently the best way to add your own listeners is to override the HbSessionDataStore and then
override the createConfiguration method (calls super and change the configuration before returning
it). You also need to register your own datastore factory using HbHelper.setHbDataStoreFactory.

I can imagine that there could be an easier solution so that you don't need to override the hbdatastore.
If you are interested in this, can you enter a bugzilla, then I can make this easier so that it is
not required to specify your hbdatastore implementation?

gr. Martin

Manfred Hahn wrote:
> Hi Martin,
>
> I like to manipulate the Hibernate configuration programmatically. I
> want to install an own event listener.
>
> Now I've found that the HbDataStore.getHibernateConfiguration() is
> protected. Since I get the HbDataStore from the HbHelper and by this way
> from a factory I don't know (and don't want to know) the implementation
> class. Is there a reason for making the getHibernateConfiguration()
> method protected?
>
> Or is there another way to configure my listener? Since the listener
> implements three interfaces a hibernate xml configuration file does not
> work.
>
> Regards
> Manfred
>
> Ps. Sorry for having so many questions today!
>


--

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: HibernateConfiguration not accessable [message #116326 is a reply to message #116322] Fri, 28 March 2008 16:04 Go to previous message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hi Martin,

I will follow your advice.

The simple approach to cast the HbDataStore to HbSessionDataStore and
getting the Configuration did not work, because the Configuration I've got
before initialization of the DataStore was null, and after the
initialization the setting of the EventListeners seem to have no effect.
My Lister was not called.

Best Regards
Manfred
Re: HibernateConfiguration not accessable [message #616027 is a reply to message #116317] Fri, 28 March 2008 15:39 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Manfred,
Many questions are no problem, they help to improve the solution.

Currently the best way to add your own listeners is to override the HbSessionDataStore and then
override the createConfiguration method (calls super and change the configuration before returning
it). You also need to register your own datastore factory using HbHelper.setHbDataStoreFactory.

I can imagine that there could be an easier solution so that you don't need to override the hbdatastore.
If you are interested in this, can you enter a bugzilla, then I can make this easier so that it is
not required to specify your hbdatastore implementation?

gr. Martin

Manfred Hahn wrote:
> Hi Martin,
>
> I like to manipulate the Hibernate configuration programmatically. I
> want to install an own event listener.
>
> Now I've found that the HbDataStore.getHibernateConfiguration() is
> protected. Since I get the HbDataStore from the HbHelper and by this way
> from a factory I don't know (and don't want to know) the implementation
> class. Is there a reason for making the getHibernateConfiguration()
> method protected?
>
> Or is there another way to configure my listener? Since the listener
> implements three interfaces a hibernate xml configuration file does not
> work.
>
> Regards
> Manfred
>
> Ps. Sorry for having so many questions today!
>


--

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: HibernateConfiguration not accessable [message #616028 is a reply to message #116322] Fri, 28 March 2008 16:04 Go to previous message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hi Martin,

I will follow your advice.

The simple approach to cast the HbDataStore to HbSessionDataStore and
getting the Configuration did not work, because the Configuration I've got
before initialization of the DataStore was null, and after the
initialization the setting of the EventListeners seem to have no effect.
My Lister was not called.

Best Regards
Manfred
Previous Topic:HibernateConfiguration not accessable
Next Topic:[CDO] Transactional Editing Domain
Goto Forum:
  


Current Time: Fri Apr 26 17:34:40 GMT 2024

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

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

Back to the top