本文整理汇总了Java中org.jooq.Configuration类的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Configuration类属于org.jooq包,在下文中一共展示了Configuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertNews
import org.jooq.Configuration; //导入依赖的package包/类
private News insertNews(final Connection con, final Configuration jooqConfig) {
final Module module = new Module(9999, "key", "", "");
final Provider provider = new Provider(9999, "Test-Provider", "", "", null);
final Category category = new Category(9999, "testKey", "", module.getId());
new InternalModuleDao(jooqConfig).insert(module);
new InternalProviderDao(jooqConfig).insert(provider);
new InternalCategoryDao(jooqConfig).insert(category);
final News news = new News(99999, provider.getId(), category.getId(), "Test-News", Locale.GERMAN,
"Lorem ipsum dolor ...", new Timestamp(System.currentTimeMillis()), "http://incomb.com",
"/img/logo.svg", 232, 32, 287389);
new NewsDao(con).saveNews(news);
return news;
}
示例2: testGet
import org.jooq.Configuration; //导入依赖的package包/类
@Test
public void testGet() {
final Configuration jooqConfig = new DefaultConfiguration().set(con).set(SQLDialect.MYSQL);
final News news = insertNews(con, jooqConfig);
final News fetchedNews = new NewsDao(con).getNews(news.getId());
assertNotNull(fetchedNews);
assertEquals(news.getTitle(), fetchedNews.getTitle());
assertEquals(news.getText(), fetchedNews.getText());
assertEquals(news.getProviderId(), fetchedNews.getProviderId());
assertEquals(news.getCategoryId(), fetchedNews.getCategoryId());
assertEquals(news.getLocale(), fetchedNews.getLocale());
assertEquals(news.getLink(), fetchedNews.getLink());
assertEquals(news.getImageUrl(), fetchedNews.getImageUrl());
assertEquals(news.getImageWidth(), fetchedNews.getImageWidth());
assertEquals(news.getImageHeight(), fetchedNews.getImageHeight());
assertEquals(news.getNewsGroupId(), fetchedNews.getNewsGroupId());
}
示例3: dbContext
import org.jooq.Configuration; //导入依赖的package包/类
@Provides
@Singleton
static DSLContext dbContext(
DataSource dataSource, @ForDatabase ListeningExecutorService dbExecutor) {
Configuration configuration =
new DefaultConfiguration()
.set(dbExecutor)
.set(SQLDialect.MYSQL)
.set(new Settings().withRenderSchema(false))
.set(new DataSourceConnectionProvider(dataSource))
.set(DatabaseUtil.sfmRecordMapperProvider());
DSLContext ctx = DSL.using(configuration);
// Eagerly trigger JOOQ classinit for better startup performance.
ctx.select().from("curio_server_framework_init").getSQL();
return ctx;
}
示例4: mdUpdateClassAttribute2
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>kloopzcm.md_update_class_attribute</code>
*/
public static void mdUpdateClassAttribute2(Configuration configuration, Integer pAttributeId, String pAttributeName, String pDataType, Boolean pIsMandatory, Boolean pIsInheritable, Boolean pIsEncrypted, Boolean pIsImmutable, Boolean pForceOnDependent, String pDefaultValue, String pValueFormat, String pDescr) {
MdUpdateClassAttribute2 p = new MdUpdateClassAttribute2();
p.setPAttributeId(pAttributeId);
p.setPAttributeName(pAttributeName);
p.setPDataType(pDataType);
p.setPIsMandatory(pIsMandatory);
p.setPIsInheritable(pIsInheritable);
p.setPIsEncrypted(pIsEncrypted);
p.setPIsImmutable(pIsImmutable);
p.setPForceOnDependent(pForceOnDependent);
p.setPDefaultValue(pDefaultValue);
p.setPValueFormat(pValueFormat);
p.setPDescr(pDescr);
p.execute(configuration);
}
示例5: mdUpdateClassAttribute1
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>kloopzcm.md_update_class_attribute</code>
*/
public static void mdUpdateClassAttribute1(Configuration configuration, Integer pAttributeId, String pAttributeName, String pDataType, Boolean pIsMandatory, Boolean pIsInheritable, Boolean pIsEncrypted, Boolean pForceOnDependent, String pDefaultValue, String pValueFormat, String pDescr) {
MdUpdateClassAttribute1 p = new MdUpdateClassAttribute1();
p.setPAttributeId(pAttributeId);
p.setPAttributeName(pAttributeName);
p.setPDataType(pDataType);
p.setPIsMandatory(pIsMandatory);
p.setPIsInheritable(pIsInheritable);
p.setPIsEncrypted(pIsEncrypted);
p.setPForceOnDependent(pForceOnDependent);
p.setPDefaultValue(pDefaultValue);
p.setPValueFormat(pValueFormat);
p.setPDescr(pDescr);
p.execute(configuration);
}
示例6: saveTaxCodes
import org.jooq.Configuration; //导入依赖的package包/类
@Override
public void saveTaxCodes(final Iterable<EasyTaxTaxCode> taxCodes) throws SQLException {
final DateTime now = new DateTime();
execute(dataSource.getConnection(), new WithConnectionCallback<Void>() {
@Override
public Void withConnection(final Connection conn) throws SQLException {
DSL.using(conn, dialect, settings).transaction(new TransactionalRunnable() {
@Override
public void run(final Configuration configuration) throws Exception {
final DSLContext dslContext = DSL.using(configuration);
for (EasyTaxTaxCode taxCode : taxCodes) {
DateTime date = taxCode.getCreatedDate() != null
? taxCode.getCreatedDate()
: now;
saveTaxCodeInternal(taxCode, date, dslContext);
}
}
});
return null;
}
});
}
示例7: djCreateRfcCi
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>kloopzcm.dj_create_rfc_ci</code>
*/
public static void djCreateRfcCi(Configuration configuration, Long pRfcId, Long pReleaseId, Long pCiId, Long pNsId, Integer pClassId, String pCiName, String pCiGoid, Integer pActionId, Integer pExecOrder, Long pLastRfcId, String pComments, String pCreatedBy) {
DjCreateRfcCi p = new DjCreateRfcCi();
p.setPRfcId(pRfcId);
p.setPReleaseId(pReleaseId);
p.setPCiId(pCiId);
p.setPNsId(pNsId);
p.setPClassId(pClassId);
p.setPCiName(pCiName);
p.setPCiGoid(pCiGoid);
p.setPActionId(pActionId);
p.setPExecOrder(pExecOrder);
p.setPLastRfcId(pLastRfcId);
p.setPComments(pComments);
p.setPCreatedBy(pCreatedBy);
p.execute(configuration);
}
示例8: djCreateRfcRelation
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>kloopzcm.dj_create_rfc_relation</code>
*/
public static void djCreateRfcRelation(Configuration configuration, Long pRfcId, Long pReleaseId, Long pNsId, Long pCiRelationId, Long pFromRfcId, Long pFromCiId, Integer pRelationId, String pRelationGoid, Long pToRfcId, Long pToCiId, Integer pActionId, Integer pExecOrder, Long pLastRfcId, String pComments, String pCreatedBy) {
DjCreateRfcRelation p = new DjCreateRfcRelation();
p.setPRfcId(pRfcId);
p.setPReleaseId(pReleaseId);
p.setPNsId(pNsId);
p.setPCiRelationId(pCiRelationId);
p.setPFromRfcId(pFromRfcId);
p.setPFromCiId(pFromCiId);
p.setPRelationId(pRelationId);
p.setPRelationGoid(pRelationGoid);
p.setPToRfcId(pToRfcId);
p.setPToCiId(pToCiId);
p.setPActionId(pActionId);
p.setPExecOrder(pExecOrder);
p.setPLastRfcId(pLastRfcId);
p.setPComments(pComments);
p.setPCreatedBy(pCreatedBy);
p.execute(configuration);
}
示例9: mdAddClassAttribute2
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>kloopzcm.md_add_class_attribute</code>
*/
public static Integer mdAddClassAttribute2(Configuration configuration, Integer pClassId, String pAttributeName, String pDataType, Boolean pIsMandatory, Boolean pIsInheritable, Boolean pIsEncrypted, Boolean pIsImmutable, Boolean pForceOnDependent, String pDefaultValue, String pValueFormat, String pDescr) {
MdAddClassAttribute2 p = new MdAddClassAttribute2();
p.setPClassId(pClassId);
p.setPAttributeName(pAttributeName);
p.setPDataType(pDataType);
p.setPIsMandatory(pIsMandatory);
p.setPIsInheritable(pIsInheritable);
p.setPIsEncrypted(pIsEncrypted);
p.setPIsImmutable(pIsImmutable);
p.setPForceOnDependent(pForceOnDependent);
p.setPDefaultValue(pDefaultValue);
p.setPValueFormat(pValueFormat);
p.setPDescr(pDescr);
p.execute(configuration);
return p.getOutAttributeId();
}
示例10: mdCreateClass2
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>kloopzcm.md_create_class</code>
*/
public static void mdCreateClass2(Configuration configuration, Integer pClassId, String pClassName, String pShortClassName, Integer pSuperClassId, String pImpl, Boolean pIsNamespace, Integer pFlags, String pAccessLevel, String pDescr, String pFormat) {
MdCreateClass2 p = new MdCreateClass2();
p.setPClassId(pClassId);
p.setPClassName(pClassName);
p.setPShortClassName(pShortClassName);
p.setPSuperClassId(pSuperClassId);
p.setPImpl(pImpl);
p.setPIsNamespace(pIsNamespace);
p.setPFlags(pFlags);
p.setPAccessLevel(pAccessLevel);
p.setPDescr(pDescr);
p.setPFormat(pFormat);
p.execute(configuration);
}
示例11: retry
import org.jooq.Configuration; //导入依赖的package包/类
public boolean retry(Configuration configuration, long taskId, String message) {
try {
return juiceDao.rerty(configuration, taskId, message);
} catch (Exception e) {
String error = "retry task error, taskId : " + taskId + ", message : " + message + ", due to : " + e.getMessage();
log.error(error);
throw new DataBaseException(DB_OPERATION_ERROR.getCode(), e.getMessage());
}
}
示例12: submit
import org.jooq.Configuration; //导入依赖的package包/类
public boolean submit(Configuration configuration, long taskId, String callbackUrl, String taskName, String taskInfo, Integer retry) {
try {
return juiceDao.submit(DSL.using(configuration), taskId, callbackUrl, taskName, taskInfo, retry);
} catch (Exception e) {
String error = "submit task error, taskId : " + taskId + ", taskName : " + taskName + ", callbackUrl : " + callbackUrl + ", due to : " + e.getMessage();
log.error(error);
throw new DataBaseException(DB_OPERATION_ERROR.getCode(), e.getMessage());
}
}
示例13: mdDeleteRelationAttribute
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>kloopzcm.md_delete_relation_attribute</code>
*/
public static void mdDeleteRelationAttribute(Configuration configuration, Integer pAttrId, Boolean pDeleteAll) {
MdDeleteRelationAttribute p = new MdDeleteRelationAttribute();
p.setPAttrId(pAttrId);
p.setPDeleteAll(pDeleteAll);
p.execute(configuration);
}
示例14: createDbClient
import org.jooq.Configuration; //导入依赖的package包/类
@Override
protected SQLClient createDbClient(JsonObject config) {
JsonObject myConfig = new JsonObject();
if(config.containsKey("db_host"))
myConfig.put("host", config.getString("db_host"));
if(config.containsKey("db_port"))
myConfig.put("port", config.getInteger("db_port"));
if(config.containsKey("db_user"))
myConfig.put("username", config.getString("db_user"));
if(config.containsKey("db_pass"))
myConfig.put("password", config.getString("db_pass"));
if(config.containsKey("db_name"))
myConfig.put("database", config.getString("db_name"));
myConfig.put("max_pool_size", config.getInteger("db_max_pool_size", 30));
Vertx vertx = AppGlobals.get().getVertx();
AsyncSQLClient dbClient = PostgreSQLClient.createNonShared(vertx, myConfig);
AsyncJooqSQLClient client = AsyncJooqSQLClient.create(vertx, dbClient);
Configuration configuration = new DefaultConfiguration();
configuration.set(SQLDialect.POSTGRES);
PagesDao dao = new PagesDao(configuration);
dao.setClient(client);
AppGlobals.get().setGlobal("dao", dao);
return dbClient;
}
示例15: randomJoke
import org.jooq.Configuration; //导入依赖的package包/类
/**
* Call <code>public.random_joke</code>
*/
public static RandomJoke randomJoke(Configuration configuration) {
RandomJoke p = new RandomJoke();
p.execute(configuration);
return p;
}