/** * Replace back ticks (if they are used) with database platform specific * quoted identifiers. */ protected String quoteIdentifiers(String s) { return databasePlatform.convertQuotedIdentifiers(s); }
/** * Strips off the Database Platform specific quoted identifier characters. */ public String removeQuotes(String dbColumn) { dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getOpenQuote(), ""); dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getCloseQuote(), ""); return dbColumn; } }
public DdlGenContext(DatabasePlatform dbPlatform, NamingConvention namingConvention){ this.dbPlatform = dbPlatform; this.dbTypeMap = dbPlatform.getDbTypeMap(); this.ddlSyntax = dbPlatform.getDbDdlSyntax(); this.newLine = ddlSyntax.getNewLine(); this.namingConvention = namingConvention; }
@Override public SqlLimitResponse limit(SqlLimitRequest request) { StringBuilder sb = new StringBuilder(512); sb.append("select "); if (request.isDistinct()) { sb.append("distinct "); } sb.append(request.getDbSql()); int maxRows = request.getMaxRows(); if (maxRows > 0) { sb.append(" ").append(NEW_LINE).append("FETCH FIRST ").append(maxRows).append(" ROWS ONLY"); } String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery()); return new SqlLimitResponse(sql, false); } }
int platformClobType = databasePlatform.getClobDbType(); int platformBlobType = databasePlatform.getBlobDbType(); databasePlatform.setDbTrueLiteral(booleanType.getDbTrueLiteral()); databasePlatform.setDbFalseLiteral(booleanType.getDbFalseLiteral()); if (offlineMigrationGeneration || (databasePlatform.isNativeUuidType() && dbUuid.useNativeType())) { typeMap.put(UUID.class, new ScalarTypeUUIDNative()); } else {
public void setDatabasePlatform(DatabasePlatform databasePlatform) { this.databasePlatform = databasePlatform; this.maxConstraintNameLength = databasePlatform.getDbDdlSyntax().getMaxConstraintNameLength(); logger.finer("Using maxConstraintNameLength of " + maxConstraintNameLength); }
/** * Create the DefaultTypeManager. */ public DefaultTypeManager(ServerConfig config, BootupClasses bootupClasses) { int clobType = config == null ? Types.CLOB : config.getDatabasePlatform().getClobDbType(); int blobType = config == null ? Types.BLOB : config.getDatabasePlatform().getBlobDbType(); this.checkImmutable = new CheckImmutable(this); this.reflectScalarBuilder = new ReflectionBasedTypeBuilder(this); this.compoundTypeMap = new ConcurrentHashMap<Class<?>, CtCompoundType<?>>(); this.typeMap = new ConcurrentHashMap<Class<?>, ScalarType<?>>(); this.nativeMap = new ConcurrentHashMap<Integer, ScalarType<?>>(); this.extraTypeFactory = new DefaultTypeFactory(config); initialiseStandard(clobType, blobType); initialiseJodaTypes(); if (bootupClasses != null) { initialiseCustomScalarTypes(bootupClasses); initialiseScalarConverters(bootupClasses); initialiseCompoundTypes(bootupClasses); } }
private IdGenerator createSequenceIdGenerator(String seqName) { return databasePlatform.createSequenceIdGenerator(backgroundExecutor, dataSource, seqName, dbSequenceBatchSize); }
int booleanDbType = serverConfig.getDatabasePlatform().getBooleanDbType();
return new DatabasePlatform();
public SqlLimitResponse limit(SqlLimitRequest request) { StringBuilder sb = new StringBuilder(512); sb.append("select "); if (request.isDistinct()){ sb.append("distinct "); } sb.append(request.getDbSql()); int firstRow = request.getFirstRow(); int maxRows = request.getMaxRows(); if (maxRows > 0) { maxRows = maxRows + 1; } sb.append(" ").append(NEW_LINE).append(LIMIT).append(" "); if (maxRows > 0) { sb.append(maxRows); } if (firstRow > 0) { sb.append(" ").append(OFFSET).append(" "); sb.append(firstRow); } String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery()); return new SqlLimitResponse(sql, false); }
public void setDatabasePlatform(DatabasePlatform databasePlatform) { this.databasePlatform = databasePlatform; this.maxConstraintNameLength = databasePlatform.getDbDdlSyntax().getMaxConstraintNameLength(); logger.finer("Using maxConstraintNameLength of " + maxConstraintNameLength); }
/** * Create the DefaultTypeManager. */ public DefaultTypeManager(ServerConfig config, BootupClasses bootupClasses) { int clobType = config == null ? Types.CLOB : config.getDatabasePlatform().getClobDbType(); int blobType = config == null ? Types.BLOB : config.getDatabasePlatform().getBlobDbType(); this.checkImmutable = new CheckImmutable(this); this.reflectScalarBuilder = new ReflectionBasedTypeBuilder(this); this.compoundTypeMap = new ConcurrentHashMap<Class<?>, CtCompoundType<?>>(); this.typeMap = new ConcurrentHashMap<Class<?>, ScalarType<?>>(); this.nativeMap = new ConcurrentHashMap<Integer, ScalarType<?>>(); this.extraTypeFactory = new DefaultTypeFactory(config); initialiseStandard(clobType, blobType); initialiseJodaTypes(); if (bootupClasses != null) { initialiseCustomScalarTypes(bootupClasses); initialiseScalarConverters(bootupClasses); initialiseCompoundTypes(bootupClasses); } }
private IdGenerator createSequenceIdGenerator(String seqName) { return databasePlatform.createSequenceIdGenerator(backgroundExecutor, dataSource, seqName, dbSequenceBatchSize); }
int booleanDbType = serverConfig.getDatabasePlatform().getBooleanDbType();
/** * Strips off the Database Platform specific quoted identifier characters. */ public String removeQuotes(String dbColumn) { dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getOpenQuote(), ""); dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getCloseQuote(), ""); return dbColumn; } }
public SqlLimitResponse limit(SqlLimitRequest request) { String dbSql = request.getDbSql(); StringBuilder sb = new StringBuilder(50 + dbSql.length()); sb.append("select "); if (request.isDistinct()) { sb.append("distinct "); } sb.append(dbSql); int firstRow = request.getFirstRow(); int maxRows = request.getMaxRows(); if (maxRows > 0 || firstRow > 0) { sb.append(" ").append(LIMIT).append(" ").append(maxRows); if (firstRow > 0) { sb.append(" ").append(OFFSET).append(" "); sb.append(firstRow); } } String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery()); return new SqlLimitResponse(sql, false); }
public DdlGenContext(DatabasePlatform dbPlatform, NamingConvention namingConvention){ this.dbPlatform = dbPlatform; this.dbTypeMap = dbPlatform.getDbTypeMap(); this.ddlSyntax = dbPlatform.getDbDdlSyntax(); this.newLine = ddlSyntax.getNewLine(); this.namingConvention = namingConvention; }
/** * Replace back ticks (if they are used) with database platform specific * quoted identifiers. */ protected String quoteIdentifiers(String s) { return databasePlatform.convertQuotedIdentifiers(s); }