Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] setting Hibernate Interceptor
[Teneo] setting Hibernate Interceptor [message #78596] Thu, 05 April 2007 18:57 Go to next message
Mark Geib is currently offline Mark Geib
Messages: 432
Registered: July 2009
Senior Member
Is there a method to call which will allow me to set a Hibernate
interceptor for
a Teneo resource or Teneo data store...?

I am working on providing client notifications of object modifications
using
the Hibernate Interceptor. I have tried setting the interceptor on the data
store I create, but my interceptor does not ever get called...

I have looked at the Teneo initialize code in the data store and it looks
like the interceptor is always set, does this prevent a user supplied
interceptor.?

Thanks,
Mark.
Re: [Teneo] setting Hibernate Interceptor [message #78611 is a reply to message #78596] Fri, 06 April 2007 02:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Only one interceptor can be set. You can override the interceptor setting by teneo in two ways:
- provide your own HbContext and create your own interceptor in the createinterceptor method
- override the hbdatastore and the setInterceptor method, this method should set your interceptor in
the configuration.

Note your interceptor must override the EMFInterceptor of Teneo or provide the same implementation
of the getEntityName method.

gr. Martin

Mark wrote:
> Is there a method to call which will allow me to set a Hibernate
> interceptor for
> a Teneo resource or Teneo data store...?
>
> I am working on providing client notifications of object modifications
> using
> the Hibernate Interceptor. I have tried setting the interceptor on the data
> store I create, but my interceptor does not ever get called...
>
> I have looked at the Teneo initialize code in the data store and it looks
> like the interceptor is always set, does this prevent a user supplied
> interceptor.?
>
> Thanks,
> Mark.
>


--

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] setting Hibernate Interceptor [message #604402 is a reply to message #78596] Fri, 06 April 2007 02:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Only one interceptor can be set. You can override the interceptor setting by teneo in two ways:
- provide your own HbContext and create your own interceptor in the createinterceptor method
- override the hbdatastore and the setInterceptor method, this method should set your interceptor in
the configuration.

Note your interceptor must override the EMFInterceptor of Teneo or provide the same implementation
of the getEntityName method.

gr. Martin

Mark wrote:
> Is there a method to call which will allow me to set a Hibernate
> interceptor for
> a Teneo resource or Teneo data store...?
>
> I am working on providing client notifications of object modifications
> using
> the Hibernate Interceptor. I have tried setting the interceptor on the data
> store I create, but my interceptor does not ever get called...
>
> I have looked at the Teneo initialize code in the data store and it looks
> like the interceptor is always set, does this prevent a user supplied
> interceptor.?
>
> Thanks,
> Mark.
>


--

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] setting Hibernate Interceptor [message #665113 is a reply to message #78596] Wed, 13 April 2011 06:37 Go to previous message
Fredrik Ferm is currently offline Fredrik Ferm
Messages: 2
Registered: April 2011
Junior Member
I'm trying to do what you suggest (both solutions) but I do not get it to work.

At first I got a NullPointerException in org.eclipse.emf.teneo.hibernate.EMFInterceptor line 132.

I tried calling the initializeExtension() method on my interceptor before using it. This led to a org.hibernate.DupicateMappingException instead.

Could you please elaborate on exactly how you register the interceptor in Teneo. What specific methods needs to be called by who and in what order?

Thanx
/ Fredrik Ferm
Previous Topic:[EMF Compare] don't ignore children of unmatched elements
Next Topic:[EMF] Relative paths in .ecore files
Goto Forum:
  


Current Time: Thu Aug 28 09:15:03 EDT 2014

Powered by FUDForum. Page generated in 0.13056 seconds