org.apache.openjpa.jdbc.schema
Class LazySchemaFactory

java.lang.Object
  extended by org.apache.openjpa.jdbc.schema.NameSet
      extended by org.apache.openjpa.jdbc.schema.SchemaGroup
          extended by org.apache.openjpa.jdbc.schema.LazySchemaFactory
All Implemented Interfaces:
java.lang.Cloneable, SchemaFactory, org.apache.openjpa.lib.conf.Configurable

public class LazySchemaFactory
extends SchemaGroup
implements SchemaFactory, org.apache.openjpa.lib.conf.Configurable

Factory that uses database metadata to construct the system schema. The lazy schema factory only loads table data as it is requested. It does not properly support operations that require knowledge of the entire schema.

Author:
Abe White

Constructor Summary
LazySchemaFactory()
           
 
Method Summary
 void endConfiguration()
           
 Sequence findSequence(java.lang.String name)
          Find the sequence with the given name in the group, using '.' as the catalog separator.
 Table findTable(java.lang.String name)
          Find the table with the given name in the group, using '.' as the catalog separator.
 boolean getForeignKeys()
           
 boolean getIndexes()
           
 boolean getPrimaryKeys()
           
 SchemaGroup readSchema()
          Return the schema group for the current object model and database.
 void setConfiguration(org.apache.openjpa.lib.conf.Configuration conf)
           
 void setForeignKeys(boolean fks)
           
 void setIndexes(boolean idx)
           
 void setPrimaryKeys(boolean pks)
           
 void startConfiguration()
           
 void storeSchema(SchemaGroup schema)
          Record the schema group after changes may have been made.
 
Methods inherited from class org.apache.openjpa.jdbc.schema.SchemaGroup
addSchema, addSchema, clone, copy, findExportedForeignKeys, findSequence, findTable, getSchema, getSchemas, importSchema, isKnownSequence, isKnownSequence, isKnownTable, isKnownTable, newColumn, newForeignKey, newIndex, newInstance, newPrimaryKey, newSchema, newSequence, newTable, newUnique, removeSchema, removeUnusedComponents
 
Methods inherited from class org.apache.openjpa.jdbc.schema.NameSet
addName, isNameTaken, removeName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazySchemaFactory

public LazySchemaFactory()
Method Detail

getPrimaryKeys

public boolean getPrimaryKeys()

setPrimaryKeys

public void setPrimaryKeys(boolean pks)

getForeignKeys

public boolean getForeignKeys()

setForeignKeys

public void setForeignKeys(boolean fks)

getIndexes

public boolean getIndexes()

setIndexes

public void setIndexes(boolean idx)

readSchema

public SchemaGroup readSchema()
Description copied from interface: SchemaFactory
Return the schema group for the current object model and database.

Specified by:
readSchema in interface SchemaFactory

storeSchema

public void storeSchema(SchemaGroup schema)
Description copied from interface: SchemaFactory
Record the schema group after changes may have been made.

Specified by:
storeSchema in interface SchemaFactory
Parameters:
schema - the schema definition for the entire system

findTable

public Table findTable(java.lang.String name)
Description copied from class: SchemaGroup
Find the table with the given name in the group, using '.' as the catalog separator. Returns null if no table found.

Overrides:
findTable in class SchemaGroup

findSequence

public Sequence findSequence(java.lang.String name)
Description copied from class: SchemaGroup
Find the sequence with the given name in the group, using '.' as the catalog separator. Returns null if no sequence found.

Overrides:
findSequence in class SchemaGroup

setConfiguration

public void setConfiguration(org.apache.openjpa.lib.conf.Configuration conf)
Specified by:
setConfiguration in interface org.apache.openjpa.lib.conf.Configurable

startConfiguration

public void startConfiguration()
Specified by:
startConfiguration in interface org.apache.openjpa.lib.conf.Configurable

endConfiguration

public void endConfiguration()
Specified by:
endConfiguration in interface org.apache.openjpa.lib.conf.Configurable


Copyright © 2006 Apache Software Foundation. All Rights Reserved.