How to get the table + column qualifier name from the TableField.
I have tried the following methods
USER.ID.toString(); // "db.user.id"
USER.ID.getName(); // "id"
How to get the table + column qualifier name from the TableField.
I have tried the following methods
USER.ID.toString(); // "db.user.id"
USER.ID.getName(); // "id"
正如您所注意到的,该TableField.toString()
方法呈现完全限定的列。你有两个选择:
String sql = USER.getName() + "." + USER.ID.getName();
Configuration
配置为省略模式名称的 a:Settings settings = new Settings();
settings.setRenderSchema(false); // Omit schema rendering
settings.setRenderNameStyle(RenderNameStyle.AS_IS); // Omit escaping names
DSLContext = DSL.using(SQLDialect.MYSQL, settings);
String sql = ctx.render(USER.ID);