Java Code Examples for org.jooq.SQLDialect#MYSQL

The following examples show how to use org.jooq.SQLDialect#MYSQL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: V22__AlterInvitations.java    From bouncr with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void migrate(Context context) throws Exception {
    Connection connection = context.getConnection();
    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);
    }
}
 
Example 2
Source File: MySQLEntityStoreAssembler.java    From attic-polygene-java with Apache License 2.0 4 votes vote down vote up
@Override
protected SQLDialect getSQLDialect()
{
    return SQLDialect.MYSQL;
}
 
Example 3
Source File: AbstractJOOQMySQLIntegrationTest.java    From high-performance-java-persistence with Apache License 2.0 4 votes vote down vote up
@Override
protected SQLDialect sqlDialect() {
    return SQLDialect.MYSQL;
}
 
Example 4
Source File: AppConfig.java    From sequenceiq-samples with Apache License 2.0 4 votes vote down vote up
@Bean
public DefaultDSLContext createDefaultDSLContext() {
    return new DefaultDSLContext(dataSourceConnectionProvider(), SQLDialect.MYSQL);
}