日期:2014-05-18 浏览次数:20781 次
public class MyNameStrategy extends DefaultNamingStrategy{
@Override
public String classToTableName(String className) {
if(className.equals("Comment")) {
className = className+new Date();
}
return super.classToTableName(className);
}
}
DateFormat format = new SimpleDateFormat("yyyyMM");
String currentDate = format.format(new Date());
if("AccessLog".equals(className)){
return "joye_access_" + currentDate;
}