Package org.nuiton.topia.persistence
Class BeanTopiaConfiguration
java.lang.Object
org.nuiton.topia.persistence.jdbc.BeanJdbcConfiguration
org.nuiton.topia.persistence.BeanTopiaConfiguration
- All Implemented Interfaces:
Serializable,JdbcConfiguration,TopiaConfiguration
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,Class<? extends TopiaService>> protected booleanprotected Stringprotected Durationprotected TopiaIdFactoryprotected booleanprotected booleanFields inherited from class org.nuiton.topia.persistence.jdbc.BeanJdbcConfiguration
jdbcConnectionPassword, jdbcConnectionUrl, jdbcConnectionUser, jdbcDriverClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeclaredService(String serviceName, Class<? extends TopiaService> serviceClassName) voidaddDeclaredService(String serviceName, Class<? extends TopiaService> serviceClassName, Map<String, String> serviceConfiguration) voidaddDeclaredService(String serviceName, String serviceClassName) voidaddDeclaredService(String serviceName, String serviceClassName, Map<String, String> serviceConfiguration) Map<String,Class<? extends TopiaService>> Topia will automatically generate an Hibernate configuration for you based on the different element of this TopiaConfiguration.Delay after which Topia should consider a query as slow then log a warn.Configuration directive to change topia Ids generation strategy.booleanYou can set it to false if you don't want Topia to deal with the schema (you keep it up to date with your own sql file).booleanIf you want to favor using HikariCP as a connection pool.booleanIf true, ToPIA will validate schema against model upon starting.voidsetDeclaredServices(Map<String, Class<? extends TopiaService>> declaredServices) voidvoidsetHibernateExtraConfiguration(Map<String, String> hibernateExtraConfiguration) voidsetInitSchema(boolean initSchema) voidsetSchemaName(String schemaName) voidsetSlowQueriesThreshold(Duration slowQueriesThreshold) voidsetTopiaIdFactory(TopiaIdFactory topiaIdFactory) voidsetTopiaIdFactoryClass(Class<? extends TopiaIdFactory> topiaIdFactoryClass) voidsetTopiaIdFactoryClassName(String topiaIdFactoryClassName) voidsetUseHikariForJdbcConnectionPooling(boolean useHikariForJdbcConnectionPooling) voidsetValidateSchema(boolean validateSchema) toString()Methods inherited from class org.nuiton.topia.persistence.jdbc.BeanJdbcConfiguration
getJdbcConnectionPassword, getJdbcConnectionUrl, getJdbcConnectionUser, getJdbcDriverClass, setJdbcConnectionPassword, setJdbcConnectionUrl, setJdbcConnectionUser, setJdbcDriverClassMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.nuiton.topia.persistence.jdbc.JdbcConfiguration
getJdbcConnectionPassword, getJdbcConnectionUrl, getJdbcConnectionUser, getJdbcDriverClass
-
Field Details
-
schemaName
-
hibernateExtraConfiguration
-
initSchema
protected boolean initSchema -
validateSchema
protected boolean validateSchema -
declaredServices
-
declaredServicesConfiguration
-
topiaIdFactory
-
useHikariForJdbcConnectionPooling
protected boolean useHikariForJdbcConnectionPooling -
slowQueriesThreshold
-
-
Constructor Details
-
BeanTopiaConfiguration
public BeanTopiaConfiguration() -
BeanTopiaConfiguration
-
-
Method Details
-
getTopiaIdFactory
Description copied from interface:TopiaConfigurationConfiguration directive to change topia Ids generation strategy.- Specified by:
getTopiaIdFactoryin interfaceTopiaConfiguration- Returns:
- FIXME
-
setTopiaIdFactory
-
setTopiaIdFactoryClassName
-
setTopiaIdFactoryClass
-
getSchemaName
- Specified by:
getSchemaNamein interfaceTopiaConfiguration
-
setSchemaName
-
getHibernateExtraConfiguration
Description copied from interface:TopiaConfigurationTopia will automatically generate an Hibernate configuration for you based on the different element of this TopiaConfiguration. However, you can tune Hibernate by adding Hibernate configuration directive to this Map. We highly recommend you to use constants inHibernateAvailableSettingsas keys of the map. You MUST NOT passSchemaToolingSettings.HBM2DDL_AUTOsince ToPIA will use validate. If you want use it, have a look atHibernateTopiaMigrationService- Specified by:
getHibernateExtraConfigurationin interfaceTopiaConfiguration- Returns:
- a map containing hibernate configuration directives that ToPIA will use when it will instantiate Hibernate.
-
setHibernateExtraConfiguration
-
isInitSchema
public boolean isInitSchema()Description copied from interface:TopiaConfigurationYou can set it to false if you don't want Topia to deal with the schema (you keep it up to date with your own sql file).- Specified by:
isInitSchemain interfaceTopiaConfiguration- Returns:
- true by default
-
setInitSchema
public void setInitSchema(boolean initSchema) -
isValidateSchema
public boolean isValidateSchema()Description copied from interface:TopiaConfigurationIf true, ToPIA will validate schema against model upon starting. ToPIA will raise aSchemaValidationTopiaExceptionif the schema is not suitable for ToPIA to run fine.- Specified by:
isValidateSchemain interfaceTopiaConfiguration- Returns:
- FIXME
-
setValidateSchema
public void setValidateSchema(boolean validateSchema) -
isUseHikariForJdbcConnectionPooling
public boolean isUseHikariForJdbcConnectionPooling()Description copied from interface:TopiaConfigurationIf you want to favor using HikariCP as a connection pool.- Specified by:
isUseHikariForJdbcConnectionPoolingin interfaceTopiaConfiguration
-
setUseHikariForJdbcConnectionPooling
public void setUseHikariForJdbcConnectionPooling(boolean useHikariForJdbcConnectionPooling) -
getSlowQueriesThreshold
Description copied from interface:TopiaConfigurationDelay after which Topia should consider a query as slow then log a warn.- Specified by:
getSlowQueriesThresholdin interfaceTopiaConfiguration
-
setSlowQueriesThreshold
-
getDeclaredServices
- Specified by:
getDeclaredServicesin interfaceTopiaConfiguration
-
setDeclaredServices
-
getDeclaredServicesConfiguration
- Specified by:
getDeclaredServicesConfigurationin interfaceTopiaConfiguration
-
setDeclaredServicesConfiguration
-
addDeclaredService
-
addDeclaredService
-
addDeclaredService
-
addDeclaredService
-
dangerousToString
- Overrides:
dangerousToStringin classBeanJdbcConfiguration
-
toString
- Overrides:
toStringin classBeanJdbcConfiguration
-