Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] @PrePersist/PreUpdate - Hibernate Interceptors - extension manager
[Teneo] @PrePersist/PreUpdate - Hibernate Interceptors - extension manager [message #901170] Fri, 10 August 2012 08:13 Go to next message
R Deepak is currently offline R DeepakFriend
Messages: 20
Registered: July 2011
Junior Member
I have a timestamp field in my model persisted using Teneo.

I would like this to be automatically updated when hibernate persists the resource to the DB.

What is the best way to do this?

Update:

I am trying to do this via hibernate interceptors. If I manually create a session with

openSession(myInterceptor), it works.

If I set the Interceptor class using the Teneo extension manager,


extensionManager.registerExtension(EMFInterceptor.class.getName(), TimeStampInterceptor.class.getName());

it does not work.

TimeStampInterceptor extends EMFInterceptor..

Is there anyother way to register a sessionFactory wide interceptor?

[Updated on: Fri, 10 August 2012 11:10]

Report message to a moderator

Re: [Teneo] @PrePersist/PreUpdate [message #901299 is a reply to message #901170] Fri, 10 August 2012 16:39 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
The best approach is to use a Hibernate interceptor in this case. See the hibernate documentation for information on
interceptors.
See this older newsgroup thread for info on how to enable this for Teneo:
http://www.eclipse.org/forums/index.php/mv/tree/24266/

gr. Martin

On 08/10/2012 10:13 AM, R Deepak wrote:
> I have a timestamp field in my model persisted using Teneo.
>
> I would like this to be automatically updated when hibernate persists the resource to the DB.
> What is the best way to do this?
>
> Thanks
> Deepak


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] @PrePersist/PreUpdate [message #901355 is a reply to message #901299] Sat, 11 August 2012 10:40 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Right we are using an interceptor to track, datetime, workstation and
user information.

For certain objects we even write a changelog which is processed by
daemon processes - if a customer really wants to we can log any change ;-).

Tom

Am 10.08.12 18:39, schrieb Martin Taal:
> Hi,
> The best approach is to use a Hibernate interceptor in this case. See
> the hibernate documentation for information on interceptors.
> See this older newsgroup thread for info on how to enable this for Teneo:
> http://www.eclipse.org/forums/index.php/mv/tree/24266/
>
> gr. Martin
>
> On 08/10/2012 10:13 AM, R Deepak wrote:
>> I have a timestamp field in my model persisted using Teneo.
>>
>> I would like this to be automatically updated when hibernate persists
>> the resource to the DB.
>> What is the best way to do this?
>>
>> Thanks
>> Deepak
>
>
Re: [Teneo] @PrePersist/PreUpdate [message #901482 is a reply to message #901299] Mon, 13 August 2012 04:22 Go to previous message
R Deepak is currently offline R DeepakFriend
Messages: 20
Registered: July 2011
Junior Member
Martin taal wrote on Fri, 10 August 2012 12:39
Hi,
The best approach is to use a Hibernate interceptor in this case. See the hibernate documentation for information on
interceptors.
See this older newsgroup thread for info on how to enable this for Teneo:
http://www.eclipse.org/forums/index.php/mv/tree/24266/


Thanks. Will try this out..
Previous Topic:How to force generation of Validator
Next Topic:EMF Resources transactional safe?
Goto Forum:
  


Current Time: Thu Mar 28 18:42:22 GMT 2024

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

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

Back to the top