Class CheckSchemaOperation
- java.lang.Object
-
- org.apache.jackrabbit.core.util.db.CheckSchemaOperation
-
public class CheckSchemaOperation extends java.lang.Object
An operation which synchronously checks the DB schema in therun()
method. TheaddVariableReplacement(String, String)
method return the instance to enable method chaining.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SCHEMA_OBJECT_PREFIX_VARIABLE
static java.lang.String
TABLE_SPACE_VARIABLE
-
Constructor Summary
Constructors Constructor Description CheckSchemaOperation(ConnectionHelper connectionhelper, java.io.InputStream ddlStream, java.lang.String tableName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckSchemaOperation
addVariableReplacement(java.lang.String var, java.lang.String replacement)
Adds a variable replacement mapping.void
run()
Checks if the required schema objects exist and creates them if they don't exist yet.
-
-
-
Field Detail
-
SCHEMA_OBJECT_PREFIX_VARIABLE
public static final java.lang.String SCHEMA_OBJECT_PREFIX_VARIABLE
- See Also:
- Constant Field Values
-
TABLE_SPACE_VARIABLE
public static final java.lang.String TABLE_SPACE_VARIABLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CheckSchemaOperation
public CheckSchemaOperation(ConnectionHelper connectionhelper, java.io.InputStream ddlStream, java.lang.String tableName)
- Parameters:
connectionhelper
- the connection helperddlStream
- the stream of the DDL to use to create the schema if necessary (closed by therun()
method)tableName
- the name of the table to use for the schema-existence-check
-
-
Method Detail
-
addVariableReplacement
public CheckSchemaOperation addVariableReplacement(java.lang.String var, java.lang.String replacement)
Adds a variable replacement mapping.- Parameters:
var
- the variablereplacement
- the replacement value- Returns:
- this
-
run
public void run() throws java.sql.SQLException, java.io.IOException
Checks if the required schema objects exist and creates them if they don't exist yet.- Throws:
java.sql.SQLException
- if an error occursjava.io.IOException
- if an error occurs
-
-