We have the following class
public class TemporalData<T> {
private T data;
private String opCode;
private Date updateTime;
// getters, setters
}
public class Employee {
private String name;
private int age;
private Date dob;
// getters, setters
}
And say, we’ve an employee_log table with all fields of employee and couple of additional columns (opCode, updateTime)
Assume this is a pattern for all log tables where we have few additional columns (in this case opCode, updateTime), we would like to have one single class that can cater to all Temporal data and hence the parameterized class.
Now, if we have to fetch employees whose attributes changed in a given duration and would like to have objects of type TemporalData returned by the DAO layer, can anyone explain how to implement an ibatis TypeHandler to handle this case? How should the type handler be configured in sqlmap xml files?
Got to know a much better and simpler solution from one of my colleagues.
The above approach would work well without any additional components.