File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate triggers Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply 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: 3670

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

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