final class RelationInfo
extends java.lang.Object
Property data is stored in a map whose keys are the local DMO's property names, and whose values are the pairings of local and foreign property names, and whether case is ignored when comparing the property values (for character property types only).
Instances of this class are created at database initialization (read from the dmo index file). The information stored within these instances is used to construct HQL query statements for the following purposes:
It is also used to null out foreign records referenced by a DMO, when the foreign record is deleted.
AssociationSyncher
,
AbstractJoin
,
ForeignNuller
Modifier and Type | Class and Description |
---|---|
private static class |
RelationInfo.PropertyData
Container object for data which defines a local/foreign property pair.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<?> |
foreignClass
Foreign (referent) DMO implementation class
|
private java.lang.Class<?> |
foreignIface
Foreign (referent) DMO interface
|
private java.lang.String |
foreignSchema
Foreign (referent) schema name
|
private java.lang.Class<?> |
localClass
Local (refering) DMO implementation class
|
private java.lang.Class<?> |
localIface
Local (refering) DMO interface
|
private java.util.Map<java.lang.String,RelationInfo.PropertyData> |
properties
Common properties which define legacy foreign key
|
private boolean |
unique
Is relation uniquely constrained at the local table?
|
Constructor and Description |
---|
RelationInfo(java.lang.Class<?> localIface,
java.lang.Class<?> localClass,
java.lang.Class<?> foreignIface,
java.lang.Class<?> foreignClass,
java.lang.String foreignSchema)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addPropertyData(java.lang.String localName,
java.lang.String foreignName,
boolean caseSensitive)
Add a pair of properties which, alone or in combination with other
pairs, define the legacy key between related database tables.
|
(package private) java.util.Iterator<java.lang.String> |
foreignProperties()
Get an iterator on all of the legacy key property names for the foreign
(referent) DMO.
|
(package private) java.lang.String |
getForeignAlias()
Get the alias of the foreign (referent) DMO, which is its unqualified
interface name with the first letter lowercased.
|
(package private) java.lang.Class<?> |
getForeignClass()
Get the implementation class of the foreign (referent) DMO.
|
(package private) java.lang.String |
getForeignClassName()
Get the unqualified name of the foreign (referent) DMO's implementation
class.
|
(package private) java.lang.Class<?> |
getForeignInterface()
Get the interface of the foreign (referent) DMO.
|
(package private) java.lang.String |
getForeignInterfaceName()
Get the unqualified name of the foreign (referent) DMO's interface.
|
(package private) java.util.Set<java.lang.String> |
getForeignProperties()
Get the set of all of the legacy key property names for the foreign
(referent) DMO.
|
(package private) java.lang.String |
getForeignSchema()
Get the name of the foreign class' schema.
|
(package private) java.lang.String |
getLocalAlias()
Get the alias of the local (refering) DMO, which is its unqualified
interface name with the first letter lowercased.
|
(package private) java.lang.Class<?> |
getLocalClass()
Get the implementation class of the local (refering) DMO.
|
(package private) java.lang.String |
getLocalClassName()
Get the unqualified name of the local (refering) DMO's implementation
class.
|
(package private) java.lang.Class<?> |
getLocalInterface()
Get the interface of the local (refering) DMO.
|
(package private) java.lang.String |
getLocalInterfaceName()
Get the unqualified name of the local (refering) DMO's interface.
|
(package private) java.util.Set<java.lang.String> |
getLocalProperties()
Get the set all of the legacy key property names for the local
(refering) DMO.
|
(package private) boolean |
isIgnoreCase(java.lang.String property)
Indicate whether the pair of properties indexed by the specified, local
property name are recorded as case insensitive properties.
|
(package private) boolean |
isUnique()
Indicate whether the relation described by this object is uniquely
constrained on the local side.
|
(package private) java.util.Iterator<java.lang.String> |
localProperties()
Get an iterator on all of the legacy key property names for the local
(refering) DMO.
|
(package private) void |
setUnique()
Record the fact that the relation described by this object is uniquely
constrained on the local side.
|
private final java.lang.Class<?> localIface
private final java.lang.Class<?> localClass
private final java.lang.Class<?> foreignIface
private final java.lang.Class<?> foreignClass
private final java.lang.String foreignSchema
private final java.util.Map<java.lang.String,RelationInfo.PropertyData> properties
private boolean unique
RelationInfo(java.lang.Class<?> localIface, java.lang.Class<?> localClass, java.lang.Class<?> foreignIface, java.lang.Class<?> foreignClass, java.lang.String foreignSchema)
localIface
- Local (refering) DMO interface.localClass
- Local (refering) DMO implementation class.foreignIface
- Foreign (referent) DMO interface.foreignClass
- Foreign (referent) DMO implementation class.void addPropertyData(java.lang.String localName, java.lang.String foreignName, boolean caseSensitive) throws java.lang.NoSuchFieldException
localName
- Name of the local DMO's property.foreignName
- Name of the foreign DMO's related property.caseSensitive
- true
if comparisons of these properties must take
case into account, else false
(meaningful for
character properties only).java.lang.NoSuchFieldException
- if the local DMO implementation class does not contain a field
with the name localName
.boolean isIgnoreCase(java.lang.String property)
property
- Name of property in the local DMO class.true
if property
represents a case
insensistive, character property, else false
.java.lang.Class<?> getLocalInterface()
java.lang.Class<?> getLocalClass()
java.lang.String getLocalAlias()
java.lang.String getLocalInterfaceName()
java.lang.String getLocalClassName()
java.lang.Class<?> getForeignInterface()
java.lang.Class<?> getForeignClass()
java.lang.String getForeignAlias()
java.lang.String getForeignInterfaceName()
java.lang.String getForeignClassName()
java.lang.String getForeignSchema()
java.util.Iterator<java.lang.String> foreignProperties()
java.util.Set<java.lang.String> getForeignProperties()
java.util.Iterator<java.lang.String> localProperties()
java.util.Set<java.lang.String> getLocalProperties()
boolean isUnique()
true
if the relation with the foreign DMO is
one-to-one; false
if it is many-to-one.void setUnique()