private static class DMOIndex.DMOMetadata
extends java.lang.Object
RelationInfo
objects
which describe the relation between this DMO's table and another.
RelationInfo
objects
which describe the inverse relation between this DMO's table and
another.
Modifier and Type | Field and Description |
---|---|
private java.util.Set<java.lang.String> |
caseSensitive
Set of case-sensitive character properties
|
private java.util.List<P2JIndex> |
dbIndexes
List of all indexes on the backing table (temp tables only)
|
private java.lang.Class<?> |
dmoClass
DMO class object
|
private java.util.Set<java.lang.String> |
encoded
Set of base-64 encoded character properties
|
private java.util.Map<java.lang.String,P2JIndexComponent> |
indexedCharCols
Map of all indexed character column names to index component
|
private java.util.List<java.util.LinkedHashSet<java.lang.String>> |
indexProps
List of all property name sets, grouped by index
|
private java.util.Map<java.lang.Class<?>,RelationInfo> |
inverseRelations
Map of all foreign relation descriptors, indexed by local class
|
private java.util.Map<java.lang.Class<?>,RelationInfo> |
relations
Map of all foreign relation descriptors, indexed by foreign class
|
private java.util.List<java.util.Set<java.lang.String>> |
uniqueConstraints
List of unique constraints (each a set of property names)
|
Constructor and Description |
---|
DMOMetadata(java.lang.Class<?> dmoClass)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addCaseSensitiveProperty(java.lang.String propertyName)
Add a name to the list of case-sensitive properties for the current DMO.
|
(package private) void |
addDatabaseIndex(P2JIndex index)
Add an object which describes a database table index.
|
(package private) void |
addEncodedProperty(java.lang.String propertyName)
Add a name to the list of base-64 encoded properties for the current
DMO.
|
(package private) void |
addUniqueConstraint(java.util.Set<java.lang.String> propertyNames)
Add a set of property names which together define the properties of
a unique constraint.
|
private void |
collectIndexData(Database database)
Collect database index data for the table associated with this
metadata object.
|
private void |
collectIndexedCharColData(Database database)
Collect a mapping of column names to
P2JIndexComponent s
for this metadata's table in the given database, for those columns
which represent text data, and which participate in an index. |
private static java.util.Map<java.lang.String,P2JIndexComponent> |
collectIndexedCharColData(java.util.Iterator<P2JIndex> idxIter)
Given an iterator over a list of
indexes , retrieve
only the character columns of those indexes. |
(package private) java.util.Iterator<P2JIndex> |
databaseIndexes(Database database)
Get an iterator on all indexes for the current DMO.
|
(package private) void |
freeze()
Make contents immutable and trim arrays to size.
|
(package private) java.lang.Class<?> |
getDMOClass()
Get the DMO implementation class.
|
(package private) java.util.Map<java.lang.String,P2JIndexComponent> |
getIndexedCharCols(Database database)
Get the map of indexed character column names to
P2JIndexComponent instances which describe their use in
individual indexes. |
(package private) RelationInfo |
getInverseRelation(java.lang.Class<?> local)
Get the relation descriptor for the relation to this object's DMO
class from
local . |
(package private) java.lang.String |
getPackage()
Get the package name associated with the DMO class represented by
this object.
|
(package private) RelationInfo |
getRelation(java.lang.Class<?> foreign)
Get the relation descriptor for the relation from this object's DMO
class to
foreign . |
(package private) java.util.Iterator<java.util.LinkedHashSet<java.lang.String>> |
indexProperties(Database database)
Get an iterator on all lists of property names in indices for the
current DMO.
|
(package private) java.util.Iterator<RelationInfo> |
inverseRelations()
Get an iterator on all foreign relation descriptors for the current
DMO, which describe relations to this table from another.
|
(package private) boolean |
isCaseSensitive(java.lang.String propertyName)
Determine whether the specified property is case-sensitive.
|
(package private) boolean |
isEncoded(java.lang.String propertyName)
Determine whether the specified property is base-64 encoded.
|
(package private) void |
putIndexedCharCol(java.lang.String colName,
P2JIndexComponent comp)
Store a
P2JIndexComponent in the map of indexed
character column names to index components. |
(package private) void |
putInverseRelation(java.lang.Class<?> local,
RelationInfo info)
Add an object which describes a foreign relation to this table from
another.
|
(package private) void |
putRelation(java.lang.Class<?> foreign,
RelationInfo info)
Add an object which describes a foreign relation from this table
to another.
|
(package private) java.util.Iterator<RelationInfo> |
relations()
Get an iterator on all foreign relation descriptors for the current
DMO, which describe relations from this table to another.
|
(package private) java.util.Iterator<java.util.Set<java.lang.String>> |
uniqueConstraints()
Get an iterator on all unique constraints for the current DMO.
|
private final java.lang.Class<?> dmoClass
private java.util.Set<java.lang.String> caseSensitive
private java.util.Set<java.lang.String> encoded
private java.util.List<java.util.Set<java.lang.String>> uniqueConstraints
private java.util.List<P2JIndex> dbIndexes
private java.util.List<java.util.LinkedHashSet<java.lang.String>> indexProps
private java.util.Map<java.lang.Class<?>,RelationInfo> relations
private java.util.Map<java.lang.Class<?>,RelationInfo> inverseRelations
private java.util.Map<java.lang.String,P2JIndexComponent> indexedCharCols
DMOMetadata(java.lang.Class<?> dmoClass)
dmoClass
- DMO implementation class object.void freeze()
java.lang.String getPackage()
java.lang.Class<?> getDMOClass()
void addCaseSensitiveProperty(java.lang.String propertyName)
propertyName
- Property name to be added.boolean isCaseSensitive(java.lang.String propertyName)
propertyName
- Name of property to check for case-sensitivity.true
if property is case-sensitive, else
false
.void addEncodedProperty(java.lang.String propertyName)
propertyName
- Property name to be added.boolean isEncoded(java.lang.String propertyName)
propertyName
- Name of property to check for encoding.true
if property is base-64 encoded, else
false
.void addUniqueConstraint(java.util.Set<java.lang.String> propertyNames)
propertyNames
- Names of the properties which participate in the unique
constraint.java.util.Iterator<java.util.Set<java.lang.String>> uniqueConstraints()
void addDatabaseIndex(P2JIndex index)
index
- Object which describes the index.java.util.Iterator<P2JIndex> databaseIndexes(Database database) throws PersistenceException
P2JIndex
objects, each of which
defines the ordered list of properties participating in an index.database
- Database containing the indices being queried.PersistenceException
- if there is an error querying index information from the
JDBC driver.java.util.Iterator<java.util.LinkedHashSet<java.lang.String>> indexProperties(Database database) throws PersistenceException
database
- Database containing the indices being queried.PersistenceException
- if there is an error querying index information from the
JDBC driver.RelationInfo getRelation(java.lang.Class<?> foreign)
foreign
.foreign
- DMO interface for the foreign table.null
if this DMO has
no foreign key relation with foreign
.void putRelation(java.lang.Class<?> foreign, RelationInfo info)
foreign
- DMO interface for the foreign table.info
- Relation descriptor.java.util.Iterator<RelationInfo> relations()
RelationInfo
objects.RelationInfo getInverseRelation(java.lang.Class<?> local)
local
.local
- DMO interface for the local table.null
if this DMO has
no inverse foreign key relation with local
.void putInverseRelation(java.lang.Class<?> local, RelationInfo info)
local
- DMO interface for the local table.info
- Relation descriptor.java.util.Iterator<RelationInfo> inverseRelations()
RelationInfo
objects.java.util.Map<java.lang.String,P2JIndexComponent> getIndexedCharCols(Database database) throws PersistenceException
P2JIndexComponent
instances which describe their use in
individual indexes.database
- Database associated with this metadata object's table.PersistenceException
- if there is an error querying index information from the
JDBC driver.void putIndexedCharCol(java.lang.String colName, P2JIndexComponent comp)
P2JIndexComponent
in the map of indexed
character column names to index components.colName
- Column namecomp
- Index component data structure.private void collectIndexData(Database database) throws PersistenceException
database
- Database which will be queried.PersistenceException
- if there is an error getting a Hibernate session when
querying index metadata.java.lang.UnsupportedOperationException
- if the underlying JDBC driver does not support the index
metadata query.private void collectIndexedCharColData(Database database) throws PersistenceException
P2JIndexComponent
s
for this metadata's table in the given database, for those columns
which represent text data, and which participate in an index.database
- Database associated with this metadata object.PersistenceException
- if there is any database error while collecting index
metadata.private static java.util.Map<java.lang.String,P2JIndexComponent> collectIndexedCharColData(java.util.Iterator<P2JIndex> idxIter)
indexes
, retrieve
only the character columns of those indexes.idxIter
- The indexes.