本文整理汇总了Java中org.jooq.conf.RenderMapping类的典型用法代码示例。如果您正苦于以下问题:Java RenderMapping类的具体用法?Java RenderMapping怎么用?Java RenderMapping使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RenderMapping类属于org.jooq.conf包,在下文中一共展示了RenderMapping类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: settings
import org.jooq.conf.RenderMapping; //导入依赖的package包/类
@Nullable
private Settings settings(final String catalog) {
return !catalog.equals(DEV_CATALOG)
? new Settings().withRenderMapping(new RenderMapping().withSchemata(new MappedSchema().withInput("hmfpatients")
.withOutput(catalog)))
: null;
}
开发者ID:hartwigmedical,项目名称:hmftools,代码行数:8,代码来源:DatabaseAccess.java
示例2: init
import org.jooq.conf.RenderMapping; //导入依赖的package包/类
public void init()
{
// Now go connect to the database:
this.logger.info("Connecting to the database...");
SqlService service = Sponge.getServiceManager().provide(SqlService.class).get();
String url = service.getConnectionUrlFromAlias("cubeengine-sql").orElse("jdbc:mysql://[email protected]:3306/minecraft");
try
{
this.dataSource = service.getDataSource(url);
}
catch (SQLException e)
{
logger.error("Could not establish connection with the database!");
throw new IllegalStateException("Could not establish connection with the database!", e);
}
this.mappedSchema = new MappedSchema();
this.settings = new Settings();
this.settings.withRenderMapping(new RenderMapping().withSchemata(this.mappedSchema));
this.settings.setExecuteLogging(false);
this.logger.info("connected!");
this.registerTable(new TableVersion());
mm.registerClassInjector(ModuleTables.class, this);
mm.registerBinding(Database.class, this);
}
开发者ID:CubeEngine,项目名称:modules-main,代码行数:31,代码来源:MySQLDatabase.java
示例3: main
import org.jooq.conf.RenderMapping; //导入依赖的package包/类
public static void main(String[] args) {
SQLDialect sqlDialect = args.length == 0 ? SQLDialect.HSQLDB : SQLDialect.POSTGRES; // SQLDialect.ORACLE
Settings settings = new Settings()
.withRenderFormatted(true)
.withRenderSchema(TRUE)
.withRenderNameStyle(RenderNameStyle.UPPER);
if (sqlDialect == SQLDialect.POSTGRES) {
String schema1Name = args[0];
String schema2Name = args[1];
settings.withRenderMapping(new RenderMapping()
.withSchemata(
new MappedSchema().withInput(SCHEMA1.getName()).withOutput(schema1Name),
new MappedSchema().withInput(SCHEMA2.getName()).withOutput(schema2Name)));
}
Configuration config = new DefaultConfiguration()
.set(sqlDialect)
.set(settings);
Configuration configuration = config;
DSLContext dsl = DSL.using(configuration);
System.out.println(
dsl.select(A.ID, A.FLAG)
.from(A)
.join(B).on(B.NAME.eq(A.NAME))
.toString());
}
开发者ID:stanislas,项目名称:jooq-with-liquibase,代码行数:30,代码来源:App.java
示例4: getSettings
import org.jooq.conf.RenderMapping; //导入依赖的package包/类
@Override
public Settings getSettings() {
if(dialect == SQLDialect.POSTGRES) {
return new Settings().withRenderNameStyle(RenderNameStyle.LOWER);
}
return updateSchema(dialect).map(s ->
new Settings()
.withRenderNameStyle(RenderNameStyle.LOWER)
.withRenderMapping(new RenderMapping()
.withSchemata(
new MappedSchema().withInput(Club.CLUB.getName())
.withOutput(s))))
.orElseGet(Settings::new);
}
开发者ID:AveryRegier,项目名称:club-tracker,代码行数:15,代码来源:ConfiguredConnector.java
示例5: afterPropertiesSet
import org.jooq.conf.RenderMapping; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
com.angkorteam.mbaas.server.bean.Configuration xml = null;
String configurationFile = this.servletContext.getInitParameter("configuration");
File file;
if (!Strings.isNullOrEmpty(configurationFile)) {
file = new File(configurationFile);
} else {
File home = new File(java.lang.System.getProperty("user.home"));
file = new File(home, ".xml/" + com.angkorteam.mbaas.server.bean.Configuration.KEY);
}
try {
xml = new com.angkorteam.mbaas.server.bean.Configuration(file);
} catch (ConfigurationException e) {
}
MappedSchema mappedSchema = new MappedSchema();
mappedSchema.withInput(xml.getString(com.angkorteam.mbaas.server.bean.Configuration.TEMP_JDBC_DATABASE));
String itest = java.lang.System.getProperty("itest");
if (itest == null || "".equals(itest)) {
mappedSchema.withOutput(xml.getString(com.angkorteam.mbaas.server.bean.Configuration.APP_JDBC_DATABASE));
} else {
mappedSchema.withOutput(xml.getString(com.angkorteam.mbaas.server.bean.Configuration.TEST_JDBC_DATABASE));
}
RenderMapping renderMapping = new RenderMapping();
renderMapping.withSchemata(mappedSchema);
Settings settings = new Settings();
settings.withRenderMapping(renderMapping);
settings.withExecuteWithOptimisticLocking(true);
settings.setUpdatablePrimaryKeys(false);
DefaultConfiguration configuration = new DefaultConfiguration();
configuration.setSettings(settings);
configuration.setDataSource(this.dataSource);
configuration.set(SQLDialect.MYSQL);
// if ("com.mysql.cj.jdbc.Driver".equals(dataSource.getDriverClassName())) {
// configuration.set(SQLDialect.MYSQL);
// } else if ("com.mysql.jdbc.Driver".equals(dataSource.getDriverClassName())) {
// configuration.set(SQLDialect.MYSQL);
// } else if ("org.hsqldb.jdbcDriver".equals(dataSource.getDriverClassName())) {
// configuration.set(SQLDialect.HSQLDB);
// } else if ("org.mariadb.jdbc.Driver".equals(dataSource.getDriverClassName())) {
// configuration.set(SQLDialect.MARIADB);
// }
this.configuration = configuration;
}
开发者ID:PkayJava,项目名称:MBaaS,代码行数:47,代码来源:ConfigurationFactoryBean.java
示例6: initPublic
import org.jooq.conf.RenderMapping; //导入依赖的package包/类
public static void initPublic(Map<String, String> properties) throws Exception {
String url = properties.get("url");
String username = properties.get("username");
String password = properties.get("password");
Properties connectionProps = new Properties();
connectionProps.put("user", username);
connectionProps.put("password", password);
Class.forName("org.hsqldb.jdbc.JDBCDriver");
Connection conn = DriverManager.getConnection(url, connectionProps);
DSLContext jooq = DSL.using(conn);
jooq.createTable(AUTHOR).column(AUTHOR.ID, SQLDataType.INTEGER).column(AUTHOR.NAME, SQLDataType.VARCHAR)
.execute();
jooq.execute("ALTER TABLE PUBLIC.author ADD PRIMARY KEY (id)");
jooq.insertInto(AUTHOR).set(AUTHOR.ID, 1).set(AUTHOR.NAME, "Tariq").execute();
jooq.execute("CREATE SCHEMA BUGRARA;");
conn.commit();
jooq = DSL.using(conn, new Settings().withRenderMapping(
new RenderMapping().withSchemata(new MappedSchema().withInput("PUBLIC").withOutput("BUGRARA"))));
jooq.createTable(AUTHOR).column(AUTHOR.ID, SQLDataType.INTEGER).column(AUTHOR.NAME, SQLDataType.VARCHAR)
.execute();
jooq.execute("ALTER TABLE BUGRARA.author ADD PRIMARY KEY (id)");
jooq.insertInto(AUTHOR).set(AUTHOR.ID, 1).set(AUTHOR.NAME, "Narmeen").execute();
conn.commit();
conn.close();
}
开发者ID:tbugrara,项目名称:dropwizard-jooq,代码行数:41,代码来源:HSQLDBInit.java
注:本文中的org.jooq.conf.RenderMapping类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论