public class TableSchemaFactory extends Object implements SchemaFactory, Configurable
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_ADD |
static String |
ACTION_DROP |
Constructor and Description |
---|
TableSchemaFactory() |
Modifier and Type | Method and Description |
---|---|
void |
dropTable()
Drops the sequence table in the DB.
|
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object.
|
JDBCConfiguration |
getConfiguration() |
String |
getPrimaryKeyColumn()
The name of the primary key column on the schema definition table.
|
String |
getSchemaColumn()
The name of the schema column on the schema definition table.
|
String |
getTable()
The name of the schema definition table.
|
static void |
main(String[] args)
Usage: java org.apache.openjpa.jdbc.schema.TableSchemaFactory
[option]* -action/-a <add | drop>
Where the following options are recognized.
|
SchemaGroup |
readSchema()
Return the schema group for the current object model and database.
|
String |
readSchemaColumn()
Returns the schema as an XML string.
|
void |
refreshTable()
Creates the schema table in the DB.
|
static boolean |
run(JDBCConfiguration conf,
String action)
Run the tool.
|
static boolean |
run(JDBCConfiguration conf,
String[] args,
Options opts)
Run the tool.
|
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.
|
void |
setPrimaryKeyColumn(String name)
The name of the primary key column on the schema definition table.
|
void |
setSchemaColumn(String name)
The name of the schema column on the schema definition table.
|
void |
setTable(String name)
The name of the schema definition table.
|
void |
setTableName(String name)
Deprecated.
Use
setTable(java.lang.String) . Retained for
backwards-compatible auto-configuration. |
void |
startConfiguration()
Invoked before bean property configuration is begun on this object.
|
void |
storeSchema(SchemaGroup schema)
Record the schema group after changes may have been made.
|
void |
writeSchemaColumn(String schema)
Writes the schema as a string to the database.
|
public static final String ACTION_ADD
public static final String ACTION_DROP
public String getTable()
OPENJPA_SCHEMA
.public void setTable(String name)
OPENJPA_SCHEMA
.@Deprecated public void setTableName(String name)
setTable(java.lang.String)
. Retained for
backwards-compatible auto-configuration.public void setPrimaryKeyColumn(String name)
ID
.public String getPrimaryKeyColumn()
ID
.public void setSchemaColumn(String name)
SCHEMA_DEF
.public String getSchemaColumn()
SCHEMA_DEF
.public JDBCConfiguration getConfiguration()
public void setConfiguration(Configuration conf)
Configurable
setConfiguration
in interface Configurable
public void startConfiguration()
Configurable
startConfiguration
in interface Configurable
public void endConfiguration()
Configurable
endConfiguration
in interface Configurable
public SchemaGroup readSchema()
SchemaFactory
readSchema
in interface SchemaFactory
public void storeSchema(SchemaGroup schema)
SchemaFactory
storeSchema
in interface SchemaFactory
schema
- the schema definition for the entire systempublic void refreshTable() throws SQLException
SQLException
public void dropTable() throws SQLException
SQLException
public String readSchemaColumn() throws SQLException
SQLException
public void writeSchemaColumn(String schema) throws SQLException
SQLException
public static void main(String[] args) throws IOException, SQLException
JDBCConfiguration
. Optional.JDBCConfiguration
can be set by
using their names and supplying a value. For example:
-licenseKey adslfja83r3lkadf
IOException
SQLException
public static boolean run(JDBCConfiguration conf, String[] args, Options opts) throws IOException, SQLException
IOException
SQLException
main(java.lang.String[])
public static boolean run(JDBCConfiguration conf, String action) throws IOException, SQLException
IOException
SQLException
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.