Class XMLSchemaParser

All Implemented Interfaces:
SchemaParser, MetaDataParser, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

public class XMLSchemaParser extends XMLMetaDataParser implements SchemaParser
Custom SAX parser used to parse Schema objects. The parser will place all parsed schemas into the current SchemaGroup, set via the setSchemaGroup(org.apache.openjpa.jdbc.schema.SchemaGroup) method. This allows parsing of multiple files into a single schema group. The parser deserializes from the following XML format:
<!ELEMENT schemas (schema)+>
<!ELEMENT schema (table|sequence)+>
<!ATTLIST schema name CDATA #IMPLIED>
<!ELEMENT table (column|index|pk|fk|unique)+>
<!ATTLIST table name CDATA #REQUIRED>
<!ELEMENT column EMPTY>
<!ATTLIST column name CDATA #REQUIRED>
<!ATTLIST column type (array|bigint|binary|bit|blob|char|clob |date|decimal|distinct|double|float|integer|java_object |longvarbinary|longvarchar|null|numeric|other|real|ref|smallint|struct |time|timstamp|tinyint|varbinary|varchar) #REQUIRED>
<!ATTLIST column type-name CDATA #IMPLIED>
<!ATTLIST column size CDATA #IMPLIED>
<!ATTLIST column decimal-digits CDATA #IMPLIED>
<!ATTLIST column not-null (true|false) "false">
<!ATTLIST column default CDATA #IMPLIED>
<!ATTLIST column auto-assign (true|false) "false">
<!ELEMENT index (on)*>
<!ATTLIST index name CDATA #REQUIRED>
<!ATTLIST index column CDATA #IMPLIED>
<!ATTLIST index unique (true|false) "false">
<!ELEMENT on EMPTY>
<!ATTLIST on column CDATA #REQUIRED>
<!ELEMENT pk (on)*>
<!ATTLIST pk name CDATA #IMPLIED>
<!ATTLIST pk column CDATA #IMPLIED>
<!ELEMENT fk (join)*>
<!ATTLIST fk name CDATA #IMPLIED>
<!ATTLIST fk deferred (true|false) "false">
<!ATTLIST fk column CDATA #IMPLIED>
<!ATTLIST fk to-table CDATA #REQUIRED>
<!ATTLIST fk delete-action (cascade|default|restrict|none|null) "none">
<!ATTLIST fk update-action (cascade|default|restrict|none|null) "none">
<!ELEMENT unique (on)*>
<!ATTLIST unique name CDATA #IMPLIED>
<!ATTLIST unique column CDATA #IMPLIED>
<!ATTLIST unique deferred (true|false) "false">
<!ELEMENT join EMPTY>
<!ATTLIST join column CDATA #IMPLIED>
<!ATTLIST join value CDATA #IMPLIED>
<!ATTLIST join to-column CDATA #REQUIRED>
<!ELEMENT sequence EMPTY>
<!ATTLIST sequence name CDATA #REQUIRED>
<!ATTLIST sequence initial-value CDATA #IMPLIED>
<!ATTLIST sequence increment CDATA #IMPLIED>
<!ATTLIST sequence allocate CDATA #IMPLIED>
Schema parsers are not threadsafe.
Author:
Abe White
  • Constructor Details

    • XMLSchemaParser

      public XMLSchemaParser(JDBCConfiguration conf)
      Constructor. Supply configuration.
  • Method Details