-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hybernate trigger for mysql
PostPosted: Mon Mar 12, 2012 6:18 am 
Newbie

Joined: Mon Mar 12, 2012 6:12 am
Posts: 1
Hi

I have to create AFTER INSERT and BEFORE UPDATE triggers on MYSQL to move data from master table to history table.

Code:

@RooJavaBean
@RooToString
@RooEntity(finders = { "findEmployeesByEmployee_id" })
public class Employee {

    @Column(unique=true)
    private Integer employee_id;

    @NotNull
    private String first_name;
}


And data has to be inserted to History from data entered for employee create screen

Code:
@RooJavaBean
@RooToString
@RooEntity(finders = { "findEmployeeHistsByEmployee_id" })
public class EmployeeHist {

    private Integer employee_id;

    private String first_name;
}


please suggest how it can be done as simply as possible, preferably using annotations as I am having these triggers currently inside database.
They have to be migrated now to Code and I am using Spring ROO for maintaining the state of DB and view.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.