|
|||||||||
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.
See #fromProperty(QualifiedName, List, String, Type, String)
,
#fromAssociation(QualifiedName, String, Type)
and #fromManyAssociation(QualifiedName, String, Type)
methods in order to instantiate this class.
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,
String tableName,
AssociationDescriptor assoDescriptor)
Creates information about specified qualified name which represents an association. |
static QNameInfo |
fromManyAssociation(QualifiedName qName,
String tableName,
ManyAssociationDescriptor manyAssoDescriptor)
Creates information about specified qualified name which represents a many-association. |
static QNameInfo |
fromProperty(QualifiedName qName,
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. |
Integer |
getCollectionDepth()
If qualified name represented by this interface is a property with collection as type, returns the amount of nested collections + 1 . |
Type |
getFinalType()
Returns the non-collection type of this qualified name. |
ManyAssociationDescriptor |
getManyAssociationDescriptor()
Returns ManyAssociationDescriptor 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. |
String |
getTableName()
Gets the table name in database, used to store values of the qualified name this interface represents. |
Boolean |
isFinalTypePrimitive()
Returns whether the final (non-collection) type of this qualified name is not seen as value composite. |
void |
setTableName(String tableName)
Sets the previously undecided table name to some specific one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public 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 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 String getTableName()
null
if it is not yet decided.public void setTableName(String tableName)
non-null
and current table name is null
.
tableName
- The new table name. Must be non-null
.
IllegalArgumentException
- If tableName
is null
.
IllegalStateException
- If current table name is non-null
.public 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 ManyAssociationDescriptor getManyAssociationDescriptor()
ManyAssociationDescriptor
associated with this many-association, if this qualified name info
represents a many-association. Returns null
otherwise.
ManyAssociationDescriptor
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, 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, 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, String tableName, ManyAssociationDescriptor 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
- ManyAssociationDescriptor
of this many-association.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |