Class SchemaGroup

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    DynamicSchemaFactory, LazySchemaFactory

    public class SchemaGroup
    extends NameSet
    implements java.lang.Cloneable
    Represents a grouping of schemas used in a database.
    Author:
    Abe White
    See Also:
    Serialized Form
    • Constructor Detail

      • SchemaGroup

        public SchemaGroup()
    • Method Detail

      • getSchemas

        public Schema[] getSchemas()
        Return all schemas.
      • getSchema

        @Deprecated
        public Schema getSchema​(java.lang.String name)
        Deprecated.
        Return the schema with the given name, or null if none.
      • addSchema

        public Schema addSchema()
        Add a schema to the group.
      • addSchema

        @Deprecated
        public Schema addSchema​(java.lang.String name)
        Deprecated.
        Parameters:
        name -
      • removeSchema

        public boolean removeSchema​(Schema schema)
        Remove the given schema from the group.
        Returns:
        true if the schema was removed, false if not in the group
      • importSchema

        public Schema importSchema​(Schema schema)
        Import a schema from another group. Foreign keys are not imported.
      • isKnownTable

        public boolean isKnownTable​(Table table)
        Return true if the given table is known to exist. While findTable(org.apache.openjpa.jdbc.schema.Table) may exhibit dynamic behavior in some schema group implementations, this method only returns true if the table has been added to this group or is known to exist in the database.
      • isKnownTable

        @Deprecated
        public boolean isKnownTable​(java.lang.String name)
        Deprecated.
        Return true if the given table is known to exist. While findTable(org.apache.openjpa.jdbc.schema.Table) may exhibit dynamic behavior in some schema group implementations, this method only returns true if the table has been added to this group or is known to exist in the database.
      • findTable

        public Table findTable​(Table table)
        Find the equivalent of the given table in this schema group. The given table that may have come from another schema group.
      • findTable

        @Deprecated
        public Table findTable​(java.lang.String name)
        Deprecated.
        Find the table with the given name in the group, using '.' as the catalog separator. Returns null if no table found.
      • findTable

        @Deprecated
        public Table findTable​(Schema inSchema,
                               java.lang.String name)
        Deprecated.
        Find the table with the given name in the group, using '.' as the catalog separator. Returns null if no table found.
      • isKnownSequence

        public boolean isKnownSequence​(Sequence seq)
        Return true if the given sequence is known to exist. While findSequence(org.apache.openjpa.jdbc.schema.Sequence) may exhibit dynamic behavior in some schema group implementations, this method only returns true if the sequence has been added to this group or is known to exist in the database.
      • isKnownSequence

        @Deprecated
        public boolean isKnownSequence​(java.lang.String name)
        Deprecated.
        Return true if the given sequence is known to exist. While findSequence(org.apache.openjpa.jdbc.schema.Sequence) may exhibit dynamic behavior in some schema group implementations, this method only returns true if the sequence has been added to this group or is known to exist in the database.
      • isKnownSequence

        public boolean isKnownSequence​(DBIdentifier name)
      • findSequence

        public Sequence findSequence​(Sequence seq)
        Find the equivalent of the given sequence in this schema group. The given sequence that may have come from another schema group.
      • findSequence

        @Deprecated
        public Sequence findSequence​(java.lang.String name)
        Deprecated.
        Find the sequence with the given name in the group, using '.' as the catalog separator. Returns null if no sequence found.
      • findSequence

        @Deprecated
        public Sequence findSequence​(Schema inSchema,
                                     java.lang.String name)
        Deprecated.
        Find the sequence with the given name in the group, using '.' as the catalog separator. Returns null if no sequence found.
      • findExportedForeignKeys

        public ForeignKey[] findExportedForeignKeys​(PrimaryKey pk)
        Find all foreign keys exported by a given primary key (all foreign keys that link to the primary key).
      • removeUnusedComponents

        public void removeUnusedComponents()
        Remove unreferenced or emtpy components from the schema.
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • newInstance

        protected SchemaGroup newInstance()
        Create a new instance of this class.
      • copy

        protected void copy​(SchemaGroup group)
        Copy cloneable state from the given instance.
      • newSchema

        @Deprecated
        protected Schema newSchema​(java.lang.String name)
        Deprecated.
        Return a new schema with the given name.
      • newSequence

        @Deprecated
        protected Sequence newSequence​(java.lang.String name,
                                       Schema schema)
        Deprecated.
        Return a new sequence with the given name and owner schema.
      • newTable

        @Deprecated
        protected Table newTable​(java.lang.String name,
                                 Schema schema)
        Deprecated.
        Return a new table with the given name and owner schema.
      • newColumn

        @Deprecated
        protected Column newColumn​(java.lang.String name,
                                   Table table)
        Deprecated.
        Return a new column with the given name and owner table.
      • newPrimaryKey

        @Deprecated
        protected PrimaryKey newPrimaryKey​(java.lang.String name,
                                           Table table)
        Deprecated.
        Return a new primary key with the given name and owner table.
      • newIndex

        @Deprecated
        protected Index newIndex​(java.lang.String name,
                                 Table table)
        Deprecated.
        Return a new index with the given name and owner table.
      • newUnique

        @Deprecated
        protected Unique newUnique​(java.lang.String name,
                                   Table table)
        Deprecated.
        Return a new unique constraint with the given name and owner table.
      • newForeignKey

        @Deprecated
        protected ForeignKey newForeignKey​(java.lang.String name,
                                           Table table)
        Deprecated.
        Return a new foreign key with the given name and owner table.