Skip to content

Instantly share code, notes, and snippets.

@wendal
Created September 7, 2015 05:38
Show Gist options
  • Save wendal/324f130278a376169fd0 to your computer and use it in GitHub Desktop.
Save wendal/324f130278a376169fd0 to your computer and use it in GitHub Desktop.
示例获取一个动态表名
public static String getTableName(Dao dao, Class<?> klass, Object t) {
final Entity<?> en = dao.getEntity(klass);
final String[] name = new String[1];
TableName.run(t, new Runnable() {
public void run() {
name[0] = en.getTableName();
}
});
return name[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment