HibernateConfiguration not accessable [message #116317] |
Fri, 28 March 2008 10:58  |
Eclipse User |
|
|
|
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 #116326 is a reply to message #116322] |
Fri, 28 March 2008 12:04  |
Eclipse User |
|
|
|
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 11:39  |
Eclipse User |
|
|
|
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 12:04  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03629 seconds