aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate triggers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate triggers" Watch "Hibernate triggers" New topic
Author

Hibernate triggers

nami shekar
Greenhorn

Joined: Sep 14, 2011
Posts: 17
Hi Friends,
I need to know how to create triggers in hibernate.
I want to create a trigger on inserting into one table. On inserting into one table i want to insert or update another table.
how this can be done.

Any suggestions would be of great help.
Thanks in advance
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

See Interceptors & Events. You can inspect/manipulate properties of an object before it is saved/updated/deleted etc...


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
nami shekar
Greenhorn

Joined: Sep 14, 2011
Posts: 17
Thanks for the quick reply Vijitha,

So we need to change in configuration file and class that implements the event.?

Is this the only way it can be done?
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

Since they are for react to events inside Hibernate, yes you need to change/implement them. It's not outside the Hibernate...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate triggers