|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.domain.schema.SchemaBootstrap
public class SchemaBootstrap
Bootstraps the schema and schema update. The schema is considered missing if the applied patch table is not present, and the schema is considered empty if the applied patch table is empty.
Nested Class Summary | |
---|---|
static class |
SchemaBootstrap.SchemaBootstrapConnectionProvider
This is a workaround for the odd Spring-Hibernate interaction during configuration. |
class |
SchemaBootstrap.UnclosableConnection
A Connection wrapper that delegates all calls to the wrapped class
except for the close methods, which are ignored. |
Field Summary | |
---|---|
static int |
DEFAULT_LOCK_RETRY_COUNT
|
static int |
DEFAULT_LOCK_RETRY_WAIT_SECONDS
|
static int |
DEFAULT_MAX_STRING_LENGTH
|
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean |
---|
log |
Constructor Summary | |
---|---|
SchemaBootstrap()
|
Method Summary | |
---|---|
int |
getHibernateMaxExecutions()
Get the limit for the hibernate executions queue |
org.springframework.orm.hibernate3.LocalSessionFactoryBean |
getLocalSessionFactory()
|
static int |
getMaxStringLength()
|
protected void |
onBootstrap(org.springframework.context.ApplicationEvent event)
|
protected void |
onShutdown(org.springframework.context.ApplicationEvent event)
|
void |
setDataSource(javax.sql.DataSource dataSource)
|
void |
setDialect(org.hibernate.dialect.Dialect dialect)
Sets the previously auto-detected Hibernate dialect. |
void |
setGlobalProperties(java.util.Properties globalProperties)
Sets the properties map from which we look up some configuration settings. |
void |
setHibernateMaxExecutions(int hibernateMaxExecutions)
Set the limit for the hibernate executions queue Less than zero always uses event amalgamation |
void |
setLocalSessionFactory(org.springframework.orm.hibernate3.LocalSessionFactoryBean localSessionFactory)
|
void |
setMaximumStringLength(int maximumStringLength)
Optionally override the system's default maximum string length. |
void |
setPostCreateScriptUrls(java.util.List postUpdateScriptUrls)
Set the scripts that must be executed after the schema has been created. |
void |
setPostUpdateScriptPatches(java.util.List scriptPatches)
Set the schema script patches that may be applied after the auto-update process. |
void |
setPreCreateScriptUrls(java.util.List preUpdateScriptUrls)
Set the scripts that must be executed before the schema has been created. |
void |
setPreUpdateScriptPatches(java.util.List scriptPatches)
Set the schema script patches that may be applied prior to the auto-update process. |
void |
setSchemaOuputFilename(java.lang.String schemaOuputFilename)
Set this to output the full database creation script |
void |
setSchemaUpdateLockRetryCount(int schemaUpdateLockRetryCount)
Set the number times that the DB must be checked for the presence of the table indicating that a schema change is in progress. |
void |
setSchemaUpdateLockRetryWaitSeconds(int schemaUpdateLockRetryWaitSeconds)
Set the wait time (seconds) between checks for the schema update lock. |
void |
setStopAfterSchemaBootstrap(boolean stopAfterSchemaBootstrap)
Set whether this component should terminate the bootstrap process after running all the usual checks and scripts. |
void |
setUpdateSchema(boolean updateSchema)
Set whether to modify the schema or not. |
void |
setValidateUpdateScriptPatches(java.util.List scriptPatches)
Set the schema script patches that must have been applied. |
static java.lang.String |
trimStringForTextFields(java.lang.String value)
Truncates or returns a string that will fit into the string columns in the schema. |
Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean |
---|
getApplicationContext, onApplicationEvent, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_LOCK_RETRY_COUNT
public static final int DEFAULT_LOCK_RETRY_WAIT_SECONDS
public static final int DEFAULT_MAX_STRING_LENGTH
Constructor Detail |
---|
public SchemaBootstrap()
Method Detail |
---|
public static final int getMaxStringLength()
public static final java.lang.String trimStringForTextFields(java.lang.String value)
SchemaBootstrap.DEFAULT_MAX_STRING_LENGTH
.
value
- the string to check
SchemaBootstrap.getMaxStringLength()
public void setDialect(org.hibernate.dialect.Dialect dialect)
dialect
- the dialectpublic void setDataSource(javax.sql.DataSource dataSource)
public void setLocalSessionFactory(org.springframework.orm.hibernate3.LocalSessionFactoryBean localSessionFactory)
public org.springframework.orm.hibernate3.LocalSessionFactoryBean getLocalSessionFactory()
public void setSchemaOuputFilename(java.lang.String schemaOuputFilename)
schemaOuputFilename
- the name of a file to dump the schema to, or null to ignorepublic void setUpdateSchema(boolean updateSchema)
updateSchema
- true to update and validate the schema, otherwise false to just
validate the schema. Default is true.public void setStopAfterSchemaBootstrap(boolean stopAfterSchemaBootstrap)
WARNING: USE FOR DEBUG AND UPGRADE TESTING ONLY
stopAfterSchemaBootstrap
- true to terminate (with exception) after
running all the usual schema updates and checks.public void setPreCreateScriptUrls(java.util.List preUpdateScriptUrls)
postCreateScriptUrls
- file URLsSchemaBootstrap.PLACEHOLDER_SCRIPT_DIALECT
public void setPostCreateScriptUrls(java.util.List postUpdateScriptUrls)
postCreateScriptUrls
- file URLsSchemaBootstrap.PLACEHOLDER_SCRIPT_DIALECT
public void setValidateUpdateScriptPatches(java.util.List scriptPatches)
scriptPatches
- a list of schema patches to checkpublic void setPreUpdateScriptPatches(java.util.List scriptPatches)
scriptPatches
- a list of schema patches to checkpublic void setPostUpdateScriptPatches(java.util.List scriptPatches)
postUpdateScriptPatches
- a list of schema patches to checkpublic void setSchemaUpdateLockRetryCount(int schemaUpdateLockRetryCount)
schemaUpdateLockRetryCount
- the number of times to retry (default 24)public void setSchemaUpdateLockRetryWaitSeconds(int schemaUpdateLockRetryWaitSeconds)
schemaUpdateLockRetryWaitSeconds
- the number of seconds between checks (default 5 seconds)public void setMaximumStringLength(int maximumStringLength)
The system - as of V2.1.2 - will attempt to adjust the maximum string length size automatically and therefore this method is not normally required. But it is possible to manually override the value if, for example, the system doesn't guess the correct maximum length or if the dialect is not explicitly catered for.
All negative or zero values are ignored and the system defaults to its best guess based on the dialect being used.
maximumStringLength
- the maximum length of the string_value columnspublic int getHibernateMaxExecutions()
public void setHibernateMaxExecutions(int hibernateMaxExecutions)
public void setGlobalProperties(java.util.Properties globalProperties)
globalProperties
- the global propertiesprotected void onBootstrap(org.springframework.context.ApplicationEvent event)
onBootstrap
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
protected void onShutdown(org.springframework.context.ApplicationEvent event)
onShutdown
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |