|
Cumulus4j API (1.2.0) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
.
Nested Class Summary | |
---|---|
protected static class |
FieldMeta.NamedQueries
|
Field Summary | |
---|---|
protected static ThreadLocal<Set<FieldMeta>> |
attachedFieldMetasInPostDetachThreadLocal
|
protected static String |
UNIQUE_SCOPE_FIELD_META
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final String UNIQUE_SCOPE_FIELD_META
protected static final ThreadLocal<Set<FieldMeta>> attachedFieldMetasInPostDetachThreadLocal
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()
protected String getUniqueScope()
protected void setUniqueScope(String uniqueScope)
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.protected void setClassMeta(ClassMeta classMeta)
public FieldMeta getOwnerFieldMeta()
primary
FieldMeta
, to which this sub-FieldMeta
belongs
or null
, if this FieldMeta
is primary.
null
.protected void setOwnerFieldMeta(FieldMeta ownerFieldMeta)
public String getFieldName()
public FieldMetaRole getRole()
classMeta
)
it will be FieldMetaRole.primary
, hence this method never returns null
.
FieldMeta
; never null
.protected PersistenceManager getPersistenceManager()
PersistenceManager
assigned to this
. If there is none, this method checks, if
this
is new. If this
was persisted before, it must have one or an IllegalStateException
is thrown.
PersistenceManager
assigned to this or null
.protected Map<FieldMetaRole,FieldMeta> getRole2SubFieldMeta()
public EmbeddedClassMeta getEmbeddedClassMeta()
public void setEmbeddedClassMeta(EmbeddedClassMeta embeddedClassMeta)
public int getDataNucleusAbsoluteFieldNumber(ExecutionContext executionContext)
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 subFieldMeta)
public void removeAllSubFieldMetasExcept(FieldMetaRole... roles)
public ClassMeta getFieldOrElementTypeClassMeta(ExecutionContext executionContext)
public AbstractClassMetaData getFieldOrElementTypeDataNucleusClassMetaData(ExecutionContext executionContext)
public Class<?> getFieldOrElementType(ExecutionContext executionContext)
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)
public void jdoPreStore()
jdoPreStore
in interface StoreCallback
|
Cumulus4j API (1.2.0) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |