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