本文整理汇总了Java中org.jooq.impl.DefaultDSLContext类的典型用法代码示例。如果您正苦于以下问题:Java DefaultDSLContext类的具体用法?Java DefaultDSLContext怎么用?Java DefaultDSLContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultDSLContext类属于org.jooq.impl包,在下文中一共展示了DefaultDSLContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: should_not_contain_where_clause_on_submissions
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test
public void should_not_contain_where_clause_on_submissions() throws Exception {
// given
SubmissionListFilter filter = new SubmissionListFilter();
filter.getStatuses().setStatuses(new ArrayList<>());
final DSLContext create = new DefaultDSLContext(SQLDialect.POSTGRES);
final SelectJoinStep step = create.select().from();
// when
SubmissionFilterAppender.appendOn(filter, step);
// then
assertThat("should not contain where clause on submissions",
step.getSQL(),
not(containsString("where 1 = 0")));
}
开发者ID:kTT,项目名称:adjule,代码行数:17,代码来源:SubmissionFilterAppenderTest.java
示例2: doInTransactionWithException
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T extends Throwable> void doInTransactionWithException(ExceptionRunnable<T> run) throws T {
Throwable[] t = new Throwable[1];
try(DSLContext c = new DefaultDSLContext(configuration)) {
c.transaction(() -> {
try {
run.run();
} catch (Throwable e) {
ExceptionUtils.rethrowRuntime(e);
t[0] = e;
}
});
}
if (t[0] != null) {
throw (T)t[0];
}
}
开发者ID:rancher,项目名称:cattle,代码行数:19,代码来源:TransactionDelegateImpl.java
示例3: test02
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test02() throws Throwable {
SQLDialect sQLDialect0 = SQLDialect.POSTGRES_9_4;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0);
Product product0 = new Product();
// Undeclared exception!
try {
WorkspaceSnapshot.selectWorkspaceClosure(defaultDSLContext0,
product0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Cannot execute query. No Connection configured
//
assertThrownBy("org.jooq.impl.AbstractQuery", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:19,代码来源:WorkspaceSnapshot_ESTest.java
示例4: test05
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test05() throws Throwable {
WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot();
Product product0 = new Product();
workspaceSnapshot0.definingProduct = product0;
DefaultConfiguration defaultConfiguration0 = new DefaultConfiguration();
NoConnectionProvider noConnectionProvider0 = (NoConnectionProvider) defaultConfiguration0.connectionProvider();
SQLDialect sQLDialect0 = SQLDialect.SQLITE;
Settings settings0 = new Settings();
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(noConnectionProvider0,
sQLDialect0,
settings0);
// Undeclared exception!
try {
workspaceSnapshot0.loadDefiningProduct(defaultDSLContext0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Cannot execute query. No Connection configured
//
assertThrownBy("org.jooq.impl.AbstractQuery", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:25,代码来源:WorkspaceSnapshot_ESTest.java
示例5: test09
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test09() throws Throwable {
WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot();
Product product0 = new Product();
workspaceSnapshot0.definingProduct = product0;
SQLDialect sQLDialect0 = SQLDialect.MARIADB;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0);
// Undeclared exception!
try {
workspaceSnapshot0.load(defaultDSLContext0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Cannot execute query. No Connection configured
//
assertThrownBy("org.jooq.impl.AbstractQuery", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:20,代码来源:WorkspaceSnapshot_ESTest.java
示例6: test10
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test10() throws Throwable {
WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot();
Product product0 = new Product();
workspaceSnapshot0.definingProduct = product0;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext((SQLDialect) null);
// Undeclared exception!
try {
workspaceSnapshot0.load(defaultDSLContext0);
fail("Expecting exception: NullPointerException");
} catch (NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
assertThrownBy("org.jooq.impl.AbstractScope", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:19,代码来源:WorkspaceSnapshot_ESTest.java
示例7: test11
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test11() throws Throwable {
UUID uUID0 = UUID.randomUUID();
SQLDialect sQLDialect0 = SQLDialect.MYSQL;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0);
// Undeclared exception!
try {
WorkspaceSnapshot.getAuthorizations(uUID0, defaultDSLContext0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Cannot execute query. No Connection configured
//
assertThrownBy("org.jooq.impl.AbstractQuery", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:18,代码来源:WorkspaceSnapshot_ESTest.java
示例8: test13
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test13() throws Throwable {
UUID uUID0 = new UUID(948L, 0L);
SQLDialect sQLDialect0 = SQLDialect.CUBRID;
Settings settings0 = new Settings();
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext((DataSource) null,
sQLDialect0,
settings0);
// Undeclared exception!
try {
WorkspaceSnapshot.getAuthorizations(uUID0, defaultDSLContext0);
fail("Expecting exception: NullPointerException");
} catch (NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
assertThrownBy("org.jooq.impl.DataSourceConnectionProvider", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:21,代码来源:WorkspaceSnapshot_ESTest.java
示例9: test14
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test14() throws Throwable {
WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot();
DefaultConfiguration defaultConfiguration0 = new DefaultConfiguration();
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(defaultConfiguration0);
// Undeclared exception!
try {
workspaceSnapshot0.deltaFrom(defaultDSLContext0,
workspaceSnapshot0);
fail("Expecting exception: NullPointerException");
} catch (NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
assertThrownBy("com.chiralbehaviors.CoRE.workspace.WorkspaceSnapshot",
e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:20,代码来源:WorkspaceSnapshot_ESTest.java
示例10: test15
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test15() throws Throwable {
SQLDialect sQLDialect0 = SQLDialect.H2;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0);
Product product0 = new Product();
try {
new WorkspaceSnapshot(product0, defaultDSLContext0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Cannot execute query. No Connection configured
//
assertThrownBy("org.jooq.impl.AbstractQuery", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:17,代码来源:WorkspaceSnapshot_ESTest.java
示例11: test18
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test18() throws Throwable {
Product product0 = new Product();
PGPoolingDataSource pGPoolingDataSource0 = PGPoolingDataSource.getDataSource("");
SQLDialect sQLDialect0 = SQLDialect.MARIADB;
Settings settings0 = new Settings();
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(pGPoolingDataSource0,
sQLDialect0,
settings0);
try {
new WorkspaceSnapshot(product0, defaultDSLContext0);
fail("Expecting exception: NullPointerException");
} catch (NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
assertThrownBy("org.jooq.impl.DataSourceConnectionProvider", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:21,代码来源:WorkspaceSnapshot_ESTest.java
示例12: test22
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test22() throws Throwable {
WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot();
Jdbc3SimpleDataSource jdbc3SimpleDataSource0 = new Jdbc3SimpleDataSource();
DataSourceConnectionProvider dataSourceConnectionProvider0 = new DataSourceConnectionProvider(jdbc3SimpleDataSource0);
SQLDialect sQLDialect0 = SQLDialect.FIREBIRD;
Settings settings0 = new Settings();
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(dataSourceConnectionProvider0,
sQLDialect0,
settings0);
// Undeclared exception!
try {
workspaceSnapshot0.load(defaultDSLContext0);
fail("Expecting exception: NullPointerException");
} catch (NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
assertThrownBy("com.chiralbehaviors.CoRE.workspace.WorkspaceSnapshot",
e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:24,代码来源:WorkspaceSnapshot_ESTest.java
示例13: test23
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test23() throws Throwable {
SQLDialect sQLDialect0 = SQLDialect.SQLITE;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext((DataSource) null,
sQLDialect0,
(Settings) null);
Product product0 = new Product();
// Undeclared exception!
try {
WorkspaceSnapshot.selectWorkspaceClosure(defaultDSLContext0,
product0);
fail("Expecting exception: NullPointerException");
} catch (NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
assertThrownBy("org.jooq.impl.DataSourceConnectionProvider", e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:21,代码来源:WorkspaceSnapshot_ESTest.java
示例14: doInTransaction
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Override
public void doInTransaction(Runnable run) {
try(DSLContext c = new DefaultDSLContext(configuration)) {
c.transaction(() -> {
run.run();
});
}
}
开发者ID:rancher,项目名称:cattle,代码行数:9,代码来源:TransactionDelegateImpl.java
示例15: doInTransactionResult
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Override
public <T> T doInTransactionResult(Supplier<T> run) {
try(DSLContext c = new DefaultDSLContext(configuration)) {
return c.transactionResult(() -> {
return run.get();
});
}
}
开发者ID:rancher,项目名称:cattle,代码行数:9,代码来源:TransactionDelegateImpl.java
示例16: test03
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test03() throws Throwable {
Future<?> future = executor.submit(new Runnable() {
@Override
public void run() {
PGPoolingDataSource pGPoolingDataSource0 = new PGPoolingDataSource();
@SuppressWarnings("deprecation")
SQLDialect sQLDialect0 = SQLDialect.SQL99;
Settings settings0 = new Settings();
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(pGPoolingDataSource0,
sQLDialect0,
settings0);
Product product0 = new Product();
// Undeclared exception!
try {
WorkspaceSnapshot.selectWorkspaceClosure(defaultDSLContext0,
product0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Error getting connection from data source [email protected]
//
assertThrownBy("org.jooq.impl.DataSourceConnectionProvider",
e);
}
}
});
future.get(4000, TimeUnit.MILLISECONDS);
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:31,代码来源:WorkspaceSnapshot_ESTest.java
示例17: test06
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test06() throws Throwable {
Future<?> future = executor.submit(new Runnable() {
@Override
public void run() {
WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot();
Product product0 = new Product();
workspaceSnapshot0.definingProduct = product0;
Jdbc3SimpleDataSource jdbc3SimpleDataSource0 = new Jdbc3SimpleDataSource();
SQLDialect sQLDialect0 = SQLDialect.POSTGRES;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(jdbc3SimpleDataSource0,
sQLDialect0);
// Undeclared exception!
try {
workspaceSnapshot0.loadDefiningProduct(defaultDSLContext0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Error getting connection from data source [email protected]
//
assertThrownBy("org.jooq.impl.DataSourceConnectionProvider",
e);
}
}
});
future.get(4000, TimeUnit.MILLISECONDS);
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:29,代码来源:WorkspaceSnapshot_ESTest.java
示例18: test12
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test12() throws Throwable {
Future<?> future = executor.submit(new Runnable() {
@Override
public void run() {
PGPoolingDataSource pGPoolingDataSource0 = new PGPoolingDataSource();
@SuppressWarnings("deprecation")
SQLDialect sQLDialect0 = SQLDialect.SQL99;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(pGPoolingDataSource0,
sQLDialect0);
// Undeclared exception!
try {
WorkspaceSnapshot.getAuthorizations((UUID) null,
defaultDSLContext0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Error getting connection from data source [email protected]
//
assertThrownBy("org.jooq.impl.DataSourceConnectionProvider",
e);
}
}
});
future.get(4000, TimeUnit.MILLISECONDS);
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:28,代码来源:WorkspaceSnapshot_ESTest.java
示例19: test17
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test17() throws Throwable {
Future<?> future = executor.submit(new Runnable() {
@Override
public void run() {
try {
WorkspaceSnapshot workspaceSnapshot0 = new WorkspaceSnapshot();
Product product0 = new Product();
workspaceSnapshot0.definingProduct = product0;
Jdbc3SimpleDataSource jdbc3SimpleDataSource0 = new Jdbc3SimpleDataSource();
DataSourceConnectionProvider dataSourceConnectionProvider0 = new DataSourceConnectionProvider(jdbc3SimpleDataSource0);
SQLDialect sQLDialect0 = SQLDialect.FIREBIRD;
Settings settings0 = new Settings();
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(dataSourceConnectionProvider0,
sQLDialect0,
settings0);
// Undeclared exception!
try {
workspaceSnapshot0.load(defaultDSLContext0);
fail("Expecting exception: RuntimeException");
} catch (RuntimeException e) {
//
// Error getting connection from data source [email protected]
//
assertThrownBy("org.jooq.impl.DataSourceConnectionProvider",
e);
}
} catch (Throwable t) {
// Need to catch declared exceptions
}
}
});
future.get(4000, TimeUnit.MILLISECONDS);
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:36,代码来源:WorkspaceSnapshot_ESTest.java
示例20: test21
import org.jooq.impl.DefaultDSLContext; //导入依赖的package包/类
@Test(timeout = 4000)
public void test21() throws Throwable {
SQLDialect sQLDialect0 = SQLDialect.POSTGRES_9_5;
DefaultDSLContext defaultDSLContext0 = new DefaultDSLContext(sQLDialect0);
URL uRL0 = MockURL.getHttpExample();
// Undeclared exception!
try {
WorkspaceSnapshot.load(defaultDSLContext0, uRL0);
fail("Expecting exception: VerifyError");
} catch (VerifyError e) {
//
// Bad type on operand stack
// Exception Details:
// Location:
// com/fasterxml/jackson/databind/ObjectMapper.<clinit>()V @62: invokespecial
// Reason:
// Type 'com/fasterxml/jackson/databind/util/StdDateFormat' (current frame, stack[8]) is not assignable to 'java/text/DateFormat'
// Current Frame:
// bci: @62
// flags: { }
// locals: { }
// stack: { uninitialized 35, uninitialized 35, null, 'com/fasterxml/jackson/databind/AnnotationIntrospector', 'com/fasterxml/jackson/databind/introspect/VisibilityChecker', null, 'com/fasterxml/jackson/databind/type/TypeFactory', null, 'com/fasterxml/jackson/databind/util/StdDateFormat', null, 'java/util/Locale', null, 'com/fasterxml/jackson/core/Base64Variant' }
// Bytecode:
// 0x0000000: 1304 16b8 06ef b304 14bb 06f1 59b7 06f2
// 0x0000010: b306 e5b8 06f5 b306 e7bb 06f7 59b7 06f8
// 0x0000020: b306 e9bb 0102 5901 b206 e5b2 06e7 01b8
// 0x0000030: 00f7 01b2 06fd 01b8 0703 01b8 0709 b707
// 0x0000040: 0cb3 00fc 1307 0eb8 0713 b113 070e b807
// 0x0000050: 13bf
// Exception Handler Table:
// bci [0, 75] => handler: 75
// Stackmap Table:
// same_locals_1_stack_item_extended(@75,Object[#1587])
//
assertThrownBy("com.chiralbehaviors.CoRE.workspace.WorkspaceSnapshot",
e);
}
}
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:40,代码来源:WorkspaceSnapshot_ESTest.java
注:本文中的org.jooq.impl.DefaultDSLContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论