java.lang.Object
io.ebean.config.PlatformConfig
Configuration for DB types such as UUID, Geometry etc.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct with defaults.PlatformConfig(PlatformConfig platformConfig) Construct based on given config - typically for DbMigration generation with many platforms.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCustomMapping(DbType type, String columnDefinition) Add a custom type mapping that applies to all platforms.voidaddCustomMapping(DbType type, String columnDefinition, io.ebean.annotation.Platform platform) Add a custom type mapping.Return the list of custom type mappings.Return a value used to represent FALSE in the database.Return a value used to represent TRUE in the database.intReturn the number of DB sequence values that should be preallocated.Return the DB type used to store UUID.intReturn the Geometry SRID.Return the IdType to use (or null for the default choice).booleanReturn true if all DB column and table names should use quoted identifiers.booleanReturn true if the collation is case sensitive.booleanReturn true if InetAddress should map to varchar column (rather than Postgres INET).booleanReturn true if Postgres FOR UPDATE should use the NO KEY option.booleanReturn true if force use of helper stored procedures for migrations.voidvoidsetAllQuotedIdentifiers(boolean allQuotedIdentifiers) Set to true if all DB column and table names should use quoted identifiers.voidsetCaseSensitiveCollation(boolean caseSensitiveCollation) Set to false to indicate that the collation is case insensitive.voidsetConstraintNaming(DbConstraintNaming constraintNaming) Set a custom database constraint naming convention.voidsetDatabaseBooleanFalse(String databaseBooleanFalse) Set the value used to represent FALSE in the database.voidsetDatabaseBooleanTrue(String databaseBooleanTrue) Set the value to represent TRUE in the database.voidsetDatabaseInetAddressVarchar(boolean databaseInetAddressVarchar) Set to true to force InetAddress to map to varchar column.voidsetDatabaseSequenceBatchSize(int databaseSequenceBatchSize) Set the number of DB sequence values that should be preallocated.voidsetDbUuid(PlatformConfig.DbUuid dbUuid) Set the DB type used to store UUID.voidsetForUpdateNoKey(boolean forUpdateNoKey) Set to true such that Postgres FOR UPDATE should use the NO KEY option.voidsetGeometrySRID(int geometrySRID) Set the Geometry SRID.voidSet the IdType to use (when the DB supports both SEQUENCE and IDENTITY and the default is not desired).voidsetUseMigrationStoredProcedures(boolean useMigrationStoredProcedures) Set true to force use of helper stored procedures for migrations.
- 
Constructor Details- 
PlatformConfigpublic PlatformConfig()Construct with defaults.
- 
PlatformConfigConstruct based on given config - typically for DbMigration generation with many platforms.
 
- 
- 
Method Details- 
getConstraintNaming
- 
setConstraintNamingSet a custom database constraint naming convention.
- 
isAllQuotedIdentifierspublic boolean isAllQuotedIdentifiers()Return true if all DB column and table names should use quoted identifiers.
- 
setAllQuotedIdentifierspublic void setAllQuotedIdentifiers(boolean allQuotedIdentifiers) Set to true if all DB column and table names should use quoted identifiers.For Postgres pgjdbc version 42.3.0 should be used with datasource property quoteReturningIdentifiers set to false (refer #2303). 
- 
isCaseSensitiveCollationpublic boolean isCaseSensitiveCollation()Return true if the collation is case sensitive.
- 
setCaseSensitiveCollationpublic void setCaseSensitiveCollation(boolean caseSensitiveCollation) Set to false to indicate that the collation is case insensitive.
- 
isUseMigrationStoredProcedurespublic boolean isUseMigrationStoredProcedures()Return true if force use of helper stored procedures for migrations.
- 
setUseMigrationStoredProcedurespublic void setUseMigrationStoredProcedures(boolean useMigrationStoredProcedures) Set true to force use of helper stored procedures for migrations.
- 
isForUpdateNoKeypublic boolean isForUpdateNoKey()Return true if Postgres FOR UPDATE should use the NO KEY option.
- 
setForUpdateNoKeypublic void setForUpdateNoKey(boolean forUpdateNoKey) Set to true such that Postgres FOR UPDATE should use the NO KEY option.
- 
getDatabaseBooleanTrueReturn a value used to represent TRUE in the database.This is used for databases that do not support boolean natively. The value returned is either a Integer or a String (e.g. "1", or "T"). 
- 
setDatabaseBooleanTrueSet the value to represent TRUE in the database.This is used for databases that do not support boolean natively. The value set is either a Integer or a String (e.g. "1", or "T"). 
- 
getDatabaseBooleanFalseReturn a value used to represent FALSE in the database.
- 
setDatabaseBooleanFalseSet the value used to represent FALSE in the database.
- 
getDatabaseSequenceBatchSizepublic int getDatabaseSequenceBatchSize()Return the number of DB sequence values that should be preallocated.
- 
setDatabaseSequenceBatchSizepublic void setDatabaseSequenceBatchSize(int databaseSequenceBatchSize) Set the number of DB sequence values that should be preallocated.
- 
getGeometrySRIDpublic int getGeometrySRID()Return the Geometry SRID.
- 
setGeometrySRIDpublic void setGeometrySRID(int geometrySRID) Set the Geometry SRID.
- 
getDbUuidReturn the DB type used to store UUID.
- 
setDbUuidSet the DB type used to store UUID.
- 
getIdTypeReturn the IdType to use (or null for the default choice).
- 
setIdTypeSet the IdType to use (when the DB supports both SEQUENCE and IDENTITY and the default is not desired).
- 
isDatabaseInetAddressVarcharpublic boolean isDatabaseInetAddressVarchar()Return true if InetAddress should map to varchar column (rather than Postgres INET).
- 
setDatabaseInetAddressVarcharpublic void setDatabaseInetAddressVarchar(boolean databaseInetAddressVarchar) Set to true to force InetAddress to map to varchar column.
- 
addCustomMappingpublic void addCustomMapping(DbType type, String columnDefinition, io.ebean.annotation.Platform platform) Add a custom type mapping.// set the default mapping for BigDecimal.class/decimal config.addCustomMapping(DbType.DECIMAL, "decimal(18,6)"); // set the default mapping for String.class/varchar but only for Postgres config.addCustomMapping(DbType.VARCHAR, "text", Platform.POSTGRES);- Parameters:
- type- The DB type this mapping should apply to
- columnDefinition- The column definition that should be used
- platform- Optionally specify the platform this mapping should apply to.
 
- 
addCustomMappingAdd a custom type mapping that applies to all platforms.// set the default mapping for BigDecimal/decimal config.addCustomMapping(DbType.DECIMAL, "decimal(18,6)"); // set the default mapping for String/varchar config.addCustomMapping(DbType.VARCHAR, "text");- Parameters:
- type- The DB type this mapping should apply to
- columnDefinition- The column definition that should be used
 
- 
getCustomTypeMappingsReturn the list of custom type mappings.
- 
loadSettings
 
-