This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread 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 Murach's Java Servlets and JSP this week in the Servlets 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: 3816

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

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
 
Similar Threads
run sql file using JDBC
which generator type to use..?
Get the current updating row, to be inserted into another table using trigger
view ddl for all triggers
How to execute two SQL stmts. simulteneously ?