This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 3826

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: 3826

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