-
Notifications
You must be signed in to change notification settings - Fork 12
CustomizedGenerator
Yong Zhu edited this page Jan 20, 2018
·
1 revision
To build a customized prime key generator just follow below steps:
- Write a class impliemnts IdGenerator interface:
public class myIdGen implements IdGenerator {
//...
}
- Use it in Java method configuration:
tableModel.addGenerator(new myIdGen ("myId"));
tableModel.column("id").STRING(30).pkey().idGenerator("myId");
3.Use a ORM tool which implemented NormalJdbcTool interface like jSqlBox, call dialect.getNexID(col.getIdGenerator(), jdbcTool, col.getColumnType()) method, the will get the generated value.
For more detail can see source code of SortedUUID.