public void setDatabasePlatform(DatabasePlatform databasePlatform) { this.databasePlatform = databasePlatform; this.maxConstraintNameLength = databasePlatform.getDbDdlSyntax().getMaxConstraintNameLength(); logger.finer("Using maxConstraintNameLength of " + maxConstraintNameLength); }
public void setDatabasePlatform(DatabasePlatform databasePlatform) { this.databasePlatform = databasePlatform; this.maxConstraintNameLength = databasePlatform.getDbDdlSyntax().getMaxConstraintNameLength(); logger.finer("Using maxConstraintNameLength of " + maxConstraintNameLength); }
public DdlGenContext(DatabasePlatform dbPlatform, NamingConvention namingConvention){ this.dbPlatform = dbPlatform; this.dbTypeMap = dbPlatform.getDbTypeMap(); this.ddlSyntax = dbPlatform.getDbDdlSyntax(); this.newLine = ddlSyntax.getNewLine(); this.namingConvention = namingConvention; }
public DdlGenContext(DatabasePlatform dbPlatform, NamingConvention namingConvention){ this.dbPlatform = dbPlatform; this.dbTypeMap = dbPlatform.getDbTypeMap(); this.ddlSyntax = dbPlatform.getDbDdlSyntax(); this.newLine = ddlSyntax.getNewLine(); this.namingConvention = namingConvention; }
public TableName getM2MJoinTableName(TableName lhsTable, TableName rhsTable) { StringBuilder buffer = new StringBuilder(); buffer.append(lhsTable.getName()); buffer.append("_"); String rhsTableName = rhsTable.getName(); if (rhsTableName.indexOf('_') < rhsPrefixLength) { // trim off a xx_ prefix if there is one rhsTableName = rhsTableName.substring(rhsTableName.indexOf('_') + 1); } buffer.append(rhsTableName); int maxConstraintNameLength = databasePlatform.getDbDdlSyntax().getMaxConstraintNameLength(); // maxConstraintNameLength is used as the max table name length. if (buffer.length() > maxConstraintNameLength) { buffer.setLength(maxConstraintNameLength); } return new TableName(lhsTable.getCatalog(), lhsTable.getSchema(), buffer.toString()); }
public TableName getM2MJoinTableName(TableName lhsTable, TableName rhsTable) { StringBuilder buffer = new StringBuilder(); buffer.append(lhsTable.getName()); buffer.append("_"); String rhsTableName = rhsTable.getName(); if (rhsTableName.indexOf('_') < rhsPrefixLength) { // trim off a xx_ prefix if there is one rhsTableName = rhsTableName.substring(rhsTableName.indexOf('_') + 1); } buffer.append(rhsTableName); int maxConstraintNameLength = databasePlatform.getDbDdlSyntax().getMaxConstraintNameLength(); // maxConstraintNameLength is used as the max table name length. if (buffer.length() > maxConstraintNameLength) { buffer.setLength(maxConstraintNameLength); } return new TableName(lhsTable.getCatalog(), lhsTable.getSchema(), buffer.toString()); }
public void configureDbConfig(ServerConfig config) { Validate.notNull(config, "Config cannot be null"); DataSourceConfig ds = new DataSourceConfig(); ds.setDriver("org.sqlite.JDBC"); ds.setUrl("jdbc:sqlite:{DIR}{NAME}.db"); ds.setUsername("bukkit"); ds.setPassword("walrus"); ds.setIsolationLevel(TransactionIsolation.getLevel("SERIALIZABLE")); if (ds.getDriver().contains("sqlite")) { config.setDatabasePlatform(new SQLitePlatform()); config.getDatabasePlatform().getDbDdlSyntax().setIdentity(""); } config.setDataSourceConfig(ds); }