|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qi4j.index.sql.support.common.QNameInfo
public final class QNameInfo
A helper interface to encapsulate information about qualified name and how it appears in database.
Nested Class Summary | |
---|---|
static class |
QNameInfo.QNameType
Currently all possible types of qualified names: QNameInfo.QNameType.PROPERTY for properties,
QNameInfo.QNameType.ASSOCIATION for associations, and QNameInfo.QNameType.MANY_ASSOCIATION for many-associations. |
Method Summary | |
---|---|
static QNameInfo |
fromAssociation(QualifiedName qName,
java.lang.String tableName,
AssociationDescriptor assoDescriptor)
Creates information about specified qualified name which represents an association. |
static QNameInfo |
fromManyAssociation(QualifiedName qName,
java.lang.String tableName,
AssociationDescriptor manyAssoDescriptor)
Creates information about specified qualified name which represents a many-association. |
static QNameInfo |
fromProperty(QualifiedName qName,
java.lang.String tableName,
PropertyDescriptor propertyDescriptor)
Creates information about specified qualified name which represents a property. |
AssociationDescriptor |
getAssociationDescriptor()
Returns AssociationDescriptor associated with this association, if this qualified
name info represents an association. |
java.lang.Integer |
getCollectionDepth()
If qualified name represented by this interface is a property with collection as type, returns the amount of nested collections + 1 . |
java.lang.reflect.Type |
getFinalType()
Returns the non-collection type of this qualified name. |
AssociationDescriptor |
getManyAssociationDescriptor()
Returns AssociationDescriptor associated with this many-association, if this
qualified name info represents a many-association. |
PropertyDescriptor |
getPropertyDescriptor()
Returns PropertyDescriptor associated with this property, if this qualified name info
represents a property. |
QualifiedName |
getQName()
Gets the qualified name this interface represents. |
QNameInfo.QNameType |
getQNameType()
Gets the type of represented qualified name: either QNameInfo.QNameType.PROPERTY for
properties, QNameInfo.QNameType.ASSOCIATION for associations, or
QNameInfo.QNameType.MANY_ASSOCIATION for many-associations. |
java.lang.String |
getTableName()
Gets the table name in database, used to store values of the qualified name this interface represents. |
java.lang.Boolean |
isFinalTypePrimitive()
Returns whether the final (non-collection) type of this qualified name is not seen as value composite. |
void |
setTableName(java.lang.String tableName)
Sets the previously undecided table name to some specific one. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.lang.Integer getCollectionDepth()
amount of nested collections + 1
. That is, assuming X
is not a
collection, for type Property<Set<X>>
this returns 1
, for
Property<Set<Set<X>>>
this returns 2
, etc. If qualified name represented by
this interface is not a property or a property with no collection type, this method returns
0
.
> 0
) of qualified name, if this interface represents
qualified name with collection property; 0
otherwise.public java.lang.reflect.Type getFinalType()
Property<X>
this
returns X
if X
is not a collection type, and for Property<Set<Y>>
this returns Y
if Y
is not a collection type.
public QualifiedName getQName()
QualifiedName
public java.lang.String getTableName()
null
if it is not yet decided.public void setTableName(java.lang.String tableName)
non-null
and current table name is null
.
tableName
- The new table name. Must be non-null
.
java.lang.IllegalArgumentException
- If tableName
is null
.
java.lang.IllegalStateException
- If current table name is non-null
.public java.lang.Boolean isFinalTypePrimitive()
false
for qualified names of type
QNameInfo.QNameType.ASSOCIATION
and QNameInfo.QNameType.MANY_ASSOCIATION
.
true
if getFinalType()
is not seen as value composite type;
false
otherwise.public PropertyDescriptor getPropertyDescriptor()
PropertyDescriptor
associated with this property, if this qualified name info
represents a property. Returns null
otherwise.
PropertyDescriptor
if this qualified name info is associated with property,
null
otherwise.public AssociationDescriptor getAssociationDescriptor()
AssociationDescriptor
associated with this association, if this qualified
name info represents an association. Returns null
otherwise.
AssociationDescriptor
if this qualified name info is associated with
association, null
otherwise.public AssociationDescriptor getManyAssociationDescriptor()
AssociationDescriptor
associated with this many-association, if this
qualified name info represents a many-association. Returns null
otherwise.
AssociationDescriptor
if this qualified name info is associated with
many-association, null
otherwise.public QNameInfo.QNameType getQNameType()
QNameInfo.QNameType.PROPERTY
for
properties, QNameInfo.QNameType.ASSOCIATION
for associations, or
QNameInfo.QNameType.MANY_ASSOCIATION
for many-associations.
QNameInfo.QNameType.PROPERTY
,
QNameInfo.QNameType.ASSOCIATION
, or QNameInfo.QNameType.MANY_ASSOCIATION
.public static QNameInfo fromProperty(QualifiedName qName, java.lang.String tableName, PropertyDescriptor propertyDescriptor)
qName
- The qualified name of property.tableName
- The table name where the values of all instances of propertiy with this
qualified name will be stored. May be null
if it is to be decided later.propertyDescriptor
- PropertyDescriptor
of this property.
public static QNameInfo fromAssociation(QualifiedName qName, java.lang.String tableName, AssociationDescriptor assoDescriptor)
qName
- The qualified name of the association.tableName
- The table name where the values of all instances of association with this
qualified name will be stored. May be null
if it is to be decided later.assoDescriptor
- AssociationDescriptor
of this association.
public static QNameInfo fromManyAssociation(QualifiedName qName, java.lang.String tableName, AssociationDescriptor manyAssoDescriptor)
qName
- The qualified name of the many-association.tableName
- The table name where the values of all instances of many-association with
this qualified name will be stored. May be null
if it is to be decided later.manyAssoDescriptor
- AssociationDescriptor
of this many-association.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |