Hi , everybody
Hibernate how to operate dynamic table ?
I know a common method: use SQLQuery.
For example:
Code:
String sql = "select title, subject , mailaddr from test_20080420 ";
List res_list = session.createSQLQuery(sql).list();
.........
Now , I want to use class 'EmailData' to encapsulate the information of table 'test_20080420' , how can i do it ? My hibernate version is 3.0 . The Object pojo EmailData class:
Code:
public class EmailData{
private String title;
private String subject;
private String mailaddr;
public EmailData(){}
public EmailData(String title,String subject,String mailaddr){
this.title = title;
this.subject = subject;
this.mailaddr = mailaddr;
}
/* the setter / getter method */
................................
}
Is there other better methods to operate dynamic table by hibernate ??