本文整理汇总了Java中org.jooq.impl.SQLDataType类的典型用法代码示例。如果您正苦于以下问题:Java SQLDataType类的具体用法?Java SQLDataType怎么用?Java SQLDataType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLDataType类属于org.jooq.impl包,在下文中一共展示了SQLDataType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try (Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("groups"))
.column(field("group_id", SQLDataType.BIGINT.identity(true)))
.column(field("name", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("description", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("write_protected", SQLDataType.BOOLEAN.nullable(false)))
.constraints(
constraint().primaryKey(field("group_id")),
constraint().unique(field("name"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:17,代码来源:V2__CreateGroups.java
示例2: setUp
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@BeforeEach
void setUp() throws Exception {
context = Helper.createInMemoryContext();
context.createTable("tableA")
.column("A", SQLDataType.INTEGER)
.column("B", SQLDataType.INTEGER)
.execute();
context.createTable("tableB")
.column("C", SQLDataType.INTEGER)
.column("D", SQLDataType.INTEGER)
.column("E", SQLDataType.INTEGER)
.execute();
Helper.loadCsv(context, "tableA.csv", "tableA");
Helper.loadCsv(context, "tableB.csv", "tableB");
}
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:19,代码来源:DatabaseValidationTest.java
示例3: basicSelectQuery
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
/**
* Build select query
*
* @return selected records
*/
private SelectSelectStep<Record16<Long, Integer, Integer, String, String, String, String, Integer, Integer, String, String, String, Byte, Timestamp, Timestamp, Long>> basicSelectQuery() {
return create.select(
TRANSFER_TIMING_FILE_TRANSITION_HISTORY_ID,
FILE.ID.as("fileId"),
ATABLE.ID.as("atableId"),
ATABLE.NAME.as("atableName"),
USER.USERNAME,
FILE.CODE,
FILE_TYPE.NAME.as("fileTypeName"),
TRANSFER_TIMING_VISUAL_COUNT,
TRANSFER_TIMING_SOMETHING_COUNT,
field(name("tableFromState", TRANSITION_STATE.NAME.getName()), SQLDataType.VARCHAR(50)).as("fromStatus"),
field(name("tableToState", TRANSITION_STATE.NAME.getName()), SQLDataType.VARCHAR(50)).as("toStatus"),
FILE_TRANSITION_HISTORY.LOCATION_IPV4,
TRANSFER_TIMING_TRANSFER_STATUS,
TRANSFER_TIMING_TRANSFER_STARTED_AT,
TRANSFER_TIMING_TRANSFER_ENDED_AT,
TRANSFER_TIMING_TRANSFER_TIME_SPENT_IN_SECONDS
);
}
开发者ID:Blackdread,项目名称:filter-sort-jooq-api,代码行数:26,代码来源:TransferTimingPageRepositoryImplPureJooq.java
示例4: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try(Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("oidc_providers"))
.column(field("oidc_provider_id", SQLDataType.BIGINT.identity(true)))
.column(field("name", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("api_key", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("api_secret", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("scope", SQLDataType.VARCHAR(100)))
.column(field("response_type", SQLDataType.VARCHAR(100)))
.column(field("authorization_endpoint", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("token_endpoint", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("token_endpoint_auth_method", SQLDataType.VARCHAR(10).nullable(false)))
.constraints(
constraint().primaryKey(field("oidc_provider_id"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:21,代码来源:V13__CreateOidcProviders.java
示例5: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try (Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("assignments"))
.column(field("group_id", SQLDataType.BIGINT.nullable(false)))
.column(field("role_id", SQLDataType.BIGINT.nullable(false)))
.column(field("realm_id", SQLDataType.BIGINT.nullable(false)))
.constraints(
constraint().primaryKey(field("group_id"), field("role_id"), field("realm_id")),
constraint().foreignKey(field("group_id")).references(table("groups"), field("group_id")),
constraint().foreignKey(field("role_id")).references(table("roles"), field("role_id")),
constraint().foreignKey(field("realm_id")).references(table("realms"), field("realm_id"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:18,代码来源:V9__CreateAssinments.java
示例6: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try (Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("realms"))
.column(field("realm_id", SQLDataType.BIGINT.identity(true)))
.column(field("name", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("url", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("application_id", SQLDataType.BIGINT.nullable(false)))
.column(field("description", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("write_protected", SQLDataType.BOOLEAN.nullable(false)))
.constraints(
constraint().primaryKey(field("realm_id")),
constraint().unique(field("name")),
constraint().foreignKey(field("application_id")).references(table("applications"), field("application_id"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:20,代码来源:V6__CreateRealms.java
示例7: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try(Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("oidc_users"))
.column(field("oidc_provider_id", SQLDataType.BIGINT.nullable(false)))
.column(field("user_id", SQLDataType.BIGINT.nullable(false)))
.column(field("oidc_sub", SQLDataType.VARCHAR(255).nullable(false)))
.constraints(
constraint().primaryKey(field("oidc_provider_id"), field("user_id")),
constraint().foreignKey(field("oidc_provider_id")).references(table("oidc_providers"), field("oidc_provider_id")),
constraint().foreignKey(field("user_id")).references(table("users"), field("user_id"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:17,代码来源:V15__CreateOidcUsers.java
示例8: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try (Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("roles"))
.column(field("role_id", SQLDataType.BIGINT.identity(true)))
.column(field("name", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("description", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("write_protected", SQLDataType.BOOLEAN.nullable(false)))
.constraints(
constraint().primaryKey(field("role_id")),
constraint().unique(field("name"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:18,代码来源:V4__CreateRoles.java
示例9: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try(Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("user_sessions"))
.column(field("user_session_id", SQLDataType.BIGINT.identity(true)))
.column(field("user_id", SQLDataType.BIGINT.nullable(false)))
.column(field("token", SQLDataType.VARCHAR(36).nullable(false)))
.column(field("remote_address", SQLDataType.VARCHAR(255)))
.column(field("user_agent", SQLDataType.VARCHAR(255)))
.column(field("created_at", SQLDataType.TIMESTAMP.nullable(false)))
.constraints(
constraint().primaryKey(field("user_session_id")),
constraint().foreignKey(field("user_id")).references(table("users"), field("user_id"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:19,代码来源:V19__CreateUserSessions.java
示例10: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try (Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("permissions"))
.column(field("permission_id", SQLDataType.BIGINT.identity(true)))
.column(field("name", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("description", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("write_protected", SQLDataType.BOOLEAN.nullable(false)))
.constraints(
constraint().primaryKey(field("permission_id")),
constraint().unique(field("name"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:17,代码来源:V5__CreatePermissions.java
示例11: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try(Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.alterTable(table("oidc_invitations"))
.renameColumn(field("oidc_sub")).to(field("oidc_payload", SQLDataType.CLOB))
.getSQL();
if (create.configuration().dialect() == SQLDialect.MYSQL) {
Matcher m = Pattern.compile("\\s+RENAME\\s+COLUMN\\s+(\\w+)\\s+TO\\s+", Pattern.CASE_INSENSITIVE).matcher(ddl);
StringBuffer sb = new StringBuffer();
if (m.find()) {
m.appendReplacement(sb, " change " + m.group(1) + " ");
m.appendTail(sb);
sb.append(" text not null");
ddl = sb.toString();
}
}
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:22,代码来源:V22__AlterInvitations.java
示例12: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection) throws Exception {
try (Statement stmt = connection.createStatement()) {
DSLContext create = DSL.using(connection);
String ddl = create.createTable(table("applications"))
.column(field("application_id", SQLDataType.BIGINT.identity(true)))
.column(field("name", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("virtual_path", SQLDataType.VARCHAR(50).nullable(false)))
.column(field("pass_to", SQLDataType.VARCHAR(255).nullable(false)))
.column(field("top_page", SQLDataType.VARCHAR(255).nullable(false)))
.column(field("description", SQLDataType.VARCHAR(100).nullable(false)))
.column(field("write_protected", SQLDataType.BOOLEAN.nullable(false)))
.constraints(
constraint().primaryKey(field("application_id")),
constraint().unique(field("virtual_path"))
).getSQL();
stmt.execute(ddl);
}
}
开发者ID:kawasima,项目名称:bouncr,代码行数:22,代码来源:V3__CreateApplications.java
示例13: createDDL
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
private String createDDL(DefaultConfiguration config) {
DSLContext create = DSL.using(config);
String ddl = create.alterTable(table("oidc_invitations"))
.renameColumn(field("oidc_sub"))
.to(field("oidc_payload", SQLDataType.CLOB))
.getSQL();
if (create.configuration().dialect() == SQLDialect.MYSQL) {
Matcher m = Pattern.compile("\\s+RENAME\\s+COLUMN\\s+(\\w+)\\s+TO\\s+", Pattern.CASE_INSENSITIVE).matcher(ddl);
StringBuffer sb = new StringBuffer();
if (m.find()) {
m.appendReplacement(sb, " change " + m.group(1) + " ");
m.appendTail(sb);
sb.append(" text not null");
ddl = sb.toString();
}
}
return ddl;
}
开发者ID:kawasima,项目名称:bouncr,代码行数:20,代码来源:RenameColumnWorkaroundTest.java
示例14: migrate
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@Override
public void migrate(Connection connection, DSLContext create) {
create.createSequence("S_AUTHOR_ID").execute();
String authorTableName = "AUTHOR";
create.createTable(authorTableName)
.column("ID", SQLDataType.INTEGER.nullable(false))
.column("FIRST_NAME", SQLDataType.VARCHAR.length(50))
.column("LAST_NAME", SQLDataType.VARCHAR.length(50).nullable(false))
.column("DATE_OF_BIRTH", SQLDataType.DATE)
.column("YEAR_OF_BIRTH", SQLDataType.INTEGER)
.column("ADDRESS", SQLDataType.VARCHAR.length(50))
.execute();
create.alterTable(authorTableName).add(constraint("PK_T_AUTHOR").primaryKey("ID")).execute();
String bookTableName = "BOOK";
create.createTable(bookTableName)
.column("ID", SQLDataType.INTEGER.nullable(false))
.column("AUTHOR_ID", SQLDataType.INTEGER.nullable(false))
.column("TITLE", SQLDataType.VARCHAR.length(400).nullable(false))
.execute();
create.alterTable(bookTableName).add(constraint("PK_T_BOOK").primaryKey("ID")).execute();
create.alterTable(bookTableName).add(
constraint("FK_T_BOOK_AUTHOR_ID").foreignKey("AUTHOR_ID").references(authorTableName, "ID"))
.execute();
}
开发者ID:cluelessjoe,项目名称:jooq-flyway-typesafe-migration,代码行数:30,代码来源:V1__createAuthorAndBookTables.java
示例15: addOCFColumns
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
private void addOCFColumns(final DBConnection icdb, final Table<?> table) {
boolean converted = Arrays.stream(table.fields())
.anyMatch(field -> field.getName().endsWith(Format.IC_SUFFIX));
if (converted) {
logger.debug("Table already converted. Skipping {}", table.getName());
return;
}
// Loop through each field and create a corresponding column
Arrays.stream(table.fields()).forEach(field -> {
// Create a svc column
icdb.getCreate().alterTable(table).add(field.getName() + Format.IC_SUFFIX, MySQLDataType.TINYBLOB)
.execute();
// Create a serial column
icdb.getCreate().alterTable(table).add(field.getName() + Format.SERIAL_SUFFIX, SQLDataType.BIGINT)
.execute();
});
}
开发者ID:Hyperparticle,项目名称:integrity-coded-database,代码行数:21,代码来源:SchemaConverter.java
示例16: of
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
public static AggregateFunction<?> of(final String input) {
final Matcher matcher = MAGIC_REGEXP.matcher(input.toLowerCase());
if (!matcher.find()) {
// Not an aggregate?
return null;
}
final SqlMapping sqlOp = SqlMapping.valueOf(matcher.group(1).toUpperCase());
final boolean isDistinct = matcher.group(2) != null;
// Note that the cast here is probably not correct (e.g. for count(distinct currency)),
// but it's a workaround for jOOQ which requires Number fields for sum, avg, etc. below
// Since we are simply generating the SQL, we don't really care what the actual column is.
final Field<BigDecimal> field = DSL.fieldByName(SQLDataType.NUMERIC, matcher.group(3));
return buildAggregateFunction(field, sqlOp, isDistinct);
}
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:17,代码来源:Aggregates.java
示例17: setUp
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
@BeforeEach
void setUp() throws Exception {
context = Helper.createInMemoryContext();
context.createTable("tableX")
.column("K", SQLDataType.CHAR(1))
.column("L", SQLDataType.CHAR(1))
.column("M", SQLDataType.CHAR(1))
.column("N", SQLDataType.CHAR(1))
.execute();
Helper.loadCsvWithNulls(context, "tableX.csv", "tableX", asList("K", "L", "M", "N"));
}
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:14,代码来源:NullHandlingTest.java
示例18: createPersonRelation
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
private void createPersonRelation() throws IOException {
context.createTable(name("person"))
.column("name", SQLDataType.VARCHAR(5))
.column("second_name", SQLDataType.VARCHAR(5))
.execute();
Helper.loadCsv(context, "person.csv", "person");
}
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:9,代码来源:QueryAcceptanceTest.java
示例19: getFields
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
private List<Field<String>> getFields() {
final List<Field<String>> fields = new ArrayList<>();
for (int index = 0; index < columnNames.size(); ++index) {
fields.add(field(name(columnNames.get(index)), SQLDataType.VARCHAR(10)));
}
return fields;
}
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:8,代码来源:TestDatabase.java
示例20: buildQuery
import org.jooq.impl.SQLDataType; //导入依赖的package包/类
/**
* Build query with select and table
*
* @param selectedField select field(s)
* @param <T> record type
* @return built query
*/
private <T extends Record> SelectOnConditionStep<T> buildQuery(final SelectSelectStep<T> selectedField) {
return selectedField
.from(TRANSFER_TIMING)
.join(FILE_TRANSITION_HISTORY).on(FILE_TRANSITION_HISTORY.ID.eq(field(name(TRANSFER_TIMING.getName(), TRANSFER_TIMING_FILE_TRANSITION_HISTORY_ID.getName()), SQLDataType.INTEGER)))
.join(ATABLE).on(ATABLE.ID.eq(FILE_TRANSITION_HISTORY.FILE_LISTING_ATABLE_ID))
.join(USER).on(USER.ID.eq(FILE_TRANSITION_HISTORY.LOCATION_USER_ID))
.join(TRANSITION_STATE.asTable("tableFromState")).on(field(name("tableFromState", TRANSITION_STATE.ID.getName())).eq(field(name(TRANSFER_TIMING.getName(), TRANSFER_TIMING_TRANSITION_STATE_FROM_ID.getName()), SQLDataType.INTEGER)))
.join(TRANSITION_STATE.asTable("tableToState")).on(field(name("tableToState", TRANSITION_STATE.ID.getName())).eq(field(name(TRANSFER_TIMING.getName(), TRANSFER_TIMING_TRANSITION_STATE_TO_ID.getName()), SQLDataType.INTEGER)))
.join(FILE).on(FILE.ID.eq(FILE_TRANSITION_HISTORY.FILE_ID))
.join(FILE_TYPE).on(FILE_TYPE.ID.eq(FILE.FILE_TYPE_ID));
}
开发者ID:Blackdread,项目名称:filter-sort-jooq-api,代码行数:19,代码来源:TransferTimingPageRepositoryImplPureJooq.java
注:本文中的org.jooq.impl.SQLDataType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论