|
Cumulus4j API (1.0.1) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cumulus4j.store.model.FieldMeta
public class FieldMeta
Persistent meta-data for a field of a persistence-capable class. Since class- and field-names are very
long we reference them indirectly via the long-identifiers of ClassMeta
and FieldMeta
,
e.g. in the relation IndexEntry.fieldMeta
.
Constructor Summary | |
---|---|
protected |
FieldMeta()
Internal constructor. |
protected |
FieldMeta(ClassMeta classMeta,
FieldMeta ownerFieldMeta,
String fieldName,
FieldMetaRole role)
Internal constructor. |
|
FieldMeta(ClassMeta classMeta,
String fieldName)
Create a FieldMeta referencing a real field. |
|
FieldMeta(FieldMeta ownerFieldMeta,
FieldMetaRole role)
Create a FieldMeta referencing a part of a field. |
Method Summary | |
---|---|
void |
addSubFieldMeta(FieldMeta subFieldMeta)
|
boolean |
equals(Object obj)
|
ClassMeta |
getClassMeta()
Get the ClassMeta to which this FieldMeta belongs. |
int |
getDataNucleusAbsoluteFieldNumber()
Get the non-persistent field-number in DataNucleus' meta-data. |
AbstractMemberMetaData |
getDataNucleusMemberMetaData(ExecutionContext executionContext)
|
long |
getFieldID()
|
String |
getFieldName()
Get the simple field name (no class prefix) of the field referenced by this meta-data-instance. |
FieldMeta |
getMappedByFieldMeta(ExecutionContext executionContext)
Get the FieldMeta of the opposite end of the mapped-by-relation. |
FieldMeta |
getOwnerFieldMeta()
Get the primary FieldMeta , to which this sub-FieldMeta belongs
or null , if this FieldMeta is primary. |
FieldMetaRole |
getRole()
Get the role of the (sub-)field. |
FieldMeta |
getSubFieldMeta(FieldMetaRole role)
Get a sub-field of this field or null , if no such sub-field exists. |
Collection<FieldMeta> |
getSubFieldMetas()
Get all sub-fields' meta-data of this field. |
int |
hashCode()
|
void |
jdoPostDetach(Object o)
|
void |
jdoPreDetach()
|
void |
removeAllSubFieldMetasExcept(FieldMetaRole... roles)
|
void |
removeSubFieldMeta(FieldMeta fieldMeta)
|
void |
setDataNucleusAbsoluteFieldNumber(int dataNucleusAbsoluteFieldNumber)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected FieldMeta()
public FieldMeta(ClassMeta classMeta, String fieldName)
FieldMeta
referencing a real field.
classMeta
- the class to which this field belongs.fieldName
- the field's name.FieldMeta(FieldMeta, FieldMetaRole)
public FieldMeta(FieldMeta ownerFieldMeta, FieldMetaRole role)
FieldMeta
referencing a part of a field. This is necessary to index keys and values of a
Map
field (i.e. 2 separate indexes for one field) as well as Collection
-elements and similar.
ownerFieldMeta
- the FieldMeta
of the real field (to which the part belongs).role
- the role (aka type) of the sub-field (aka part).FieldMeta(ClassMeta, String)
protected FieldMeta(ClassMeta classMeta, FieldMeta ownerFieldMeta, String fieldName, FieldMetaRole role)
Method Detail |
---|
public long getFieldID()
public ClassMeta getClassMeta()
ClassMeta
to which this FieldMeta
belongs. Every FieldMeta
belongs to exactly one ClassMeta
just like a field is declared in exactly one Java class.
Note, that a FieldMeta
might belong to another FieldMeta in order to reference sub-field-properties,
e.g. a Map
's key. In this case, the direct property classMeta
is null
, but this method
still returns the correct ClassMeta
by resolving it indirectly via the ownerFieldMeta
.
ClassMeta
to which this instance of FieldMeta
belongs.public FieldMeta getOwnerFieldMeta()
primary
FieldMeta
, to which this sub-FieldMeta
belongs
or null
, if this FieldMeta
is primary.
null
.public String getFieldName()
public FieldMetaRole getRole()
classMeta
)
it will be FieldMetaRole.primary
, hence this method never returns null
.
FieldMeta
; never null
.public int getDataNucleusAbsoluteFieldNumber()
FieldMeta
was obtained via
Cumulus4jStoreManager.getClassMeta(org.datanucleus.store.ExecutionContext, Class)
; otherwise
it is -1.
public void setDataNucleusAbsoluteFieldNumber(int dataNucleusAbsoluteFieldNumber)
public FieldMeta getSubFieldMeta(FieldMetaRole role)
null
, if no such sub-field exists.
role
- the role of the sub-field. Must not be null
.
FieldMeta
or null
.public Collection<FieldMeta> getSubFieldMetas()
FieldMeta
s of this field; never null
.public void addSubFieldMeta(FieldMeta subFieldMeta)
public void removeSubFieldMeta(FieldMeta fieldMeta)
public void removeAllSubFieldMetasExcept(FieldMetaRole... roles)
public FieldMeta getMappedByFieldMeta(ExecutionContext executionContext)
Get the FieldMeta
of the opposite end of the mapped-by-relation. If
this is not a mapped-by field, this method returns null
.
Though, it returns always the mapped-by opposite side, the semantics of
this method still depend on the role
of this FieldMeta
:
FieldMetaRole.primary
: Returns the owner-field on the opposite side which is referenced by
@Persistent(mappedBy="owner")FieldMetaRole.mapKey
: Returns the key-field on the opposite side which is referenced by
@Key(mappedBy="key")FieldMetaRole.mapValue
: Returns the value-field on the opposite side which is referenced by
@Value(mappedBy="value")
FieldMeta
of the other end of the mapped-by-relation.public void jdoPreDetach()
jdoPreDetach
in interface DetachCallback
public void jdoPostDetach(Object o)
jdoPostDetach
in interface DetachCallback
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public AbstractMemberMetaData getDataNucleusMemberMetaData(ExecutionContext executionContext)
|
Cumulus4j API (1.0.1) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |