|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.persist.impl.Format
com.sleepycat.persist.impl.ComplexFormat
public class ComplexFormat
Format for persistent complex classes that are not not composite key classes. This includes entity classes and subclasses.
Field Summary |
---|
Fields inherited from class com.sleepycat.persist.impl.Format |
---|
ID_BIGDEC, ID_BIGINT, ID_BOOL, ID_BOOL_W, ID_BYTE, ID_BYTE_W, ID_CHAR, ID_CHAR_W, ID_DATE, ID_DOUBLE, ID_DOUBLE_W, ID_FLOAT, ID_FLOAT_W, ID_INT, ID_INT_W, ID_LONG, ID_LONG_W, ID_NULL, ID_OBJECT, ID_PREDEFINED, ID_SHORT, ID_SHORT_W, ID_SIMPLE_MAX, ID_SIMPLE_MIN, ID_STRING |
Constructor Summary | |
---|---|
ComplexFormat(Class cls,
ClassMetadata clsMeta,
EntityMetadata entityMeta)
|
Method Summary | |
---|---|
(package private) void |
collectRelatedFormats(Catalog catalog,
Map<String,Format> newFormats)
Calls catalog.createFormat for formats that this format depends on, or that should also be persistent. |
(package private) void |
copySecMultiKey(EntityInput input,
Format keyFormat,
Set results)
Called after skipToSecKey() to copy the data bytes of an array or collection (XXX_TO_MANY) key field. |
boolean |
equals(Object other)
Used to compare the current version and an old version, to determine whether class evolution is needed. |
(package private) ClassMetadata |
getClassMetadata()
Returns the original model class metadata used to create this class, or null if this is not a model class. |
(package private) Format |
getEntityFormat()
For an entity class or subclass, returns the base entity class; returns null in other cases. |
(package private) EntityMetadata |
getEntityMetadata()
Returns the original model entity metadata used to create this class, or null if this is not an entity class. |
Map<String,RawField> |
getFields()
Returns a map of field name to raw field for each non-static non-transient field declared in this class, or null if this is not a complex type (in other words, this is a simple type or an array type). |
(package private) String |
getPriKeyField()
|
(package private) void |
initialize(Catalog catalog)
Initializes an uninitialized format, initializing its related formats (superclass formats and array component formats) first. |
(package private) boolean |
isEntity()
Returns whether this format class is an entity class. |
(package private) boolean |
isModelClass()
Returns whether this class is present in the EntityModel. |
(package private) boolean |
isPriKeyNullOrZero(Object o,
boolean rawAccess)
Returns whether the entity's primary key field is null or zero, as defined for primary keys that are assigned from a sequence. |
(package private) Object |
newArray(int len)
Creates an array of the format's class of the given length, as if Array.newInstance(getType(), len) were called. |
(package private) Object |
newInstance(EntityInput input,
boolean rawAccess)
Creates a new instance of the target class using its default constructor. |
(package private) boolean |
nullifySecKey(Catalog catalog,
Object entity,
String keyName,
Object keyElement)
Nullifies the given key field in the given RawObject -- rawAccess mode is implied. |
(package private) void |
readObject(Object o,
EntityInput input,
boolean rawAccess)
Called after newInstance() to read the rest of the data bytes and fill in the object contents. |
(package private) void |
readPriKey(Object o,
EntityInput input,
boolean rawAccess)
Reads the primary key from the given input bytes and sets the primary key field in the given object. |
(package private) void |
skipContents(EntityInput input)
Skips over the object's contents, as if readObject() were called, but without returning an object. |
(package private) Format |
skipToSecKey(EntityInput input,
String keyName)
When extracting a secondary key, called to skip over all fields up to the given secondary key field. |
(package private) void |
writeObject(Object o,
EntityOutput output,
boolean rawAccess)
Writes a given instance of the target class to the output data bytes. |
(package private) void |
writePriKey(Object o,
EntityOutput output,
boolean rawAccess)
Gets the primary key field from the given object and writes it to the given output data bytes. |
Methods inherited from class com.sleepycat.persist.impl.Format |
---|
copySecKey, evolveTo, getClassName, getComponentType, getDimensions, getEnumConstants, getId, getProxiedFormat, getSuperFormat, getSuperType, getType, getVersion, getWrapperFormat, initializeIfNeeded, isArray, isAssignableTo, isCurrentVersion, isEnum, isPredefined, isPrimitive, isSimple, setId, setProxiedFormat, setSuperFormat |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
ComplexFormat(Class cls, ClassMetadata clsMeta, EntityMetadata entityMeta)
Method Detail |
---|
String getPriKeyField()
boolean isEntity()
Format
isEntity
in class Format
boolean isModelClass()
Format
isModelClass
in class Format
ClassMetadata getClassMetadata()
Format
getClassMetadata
in class Format
EntityMetadata getEntityMetadata()
Format
getEntityMetadata
in class Format
Format getEntityFormat()
Format
getEntityFormat
in class Format
public Map<String,RawField> getFields()
RawType
getFields
in interface RawType
getFields
in class Format
void collectRelatedFormats(Catalog catalog, Map<String,Format> newFormats)
Format
collectRelatedFormats
in class Format
void initialize(Catalog catalog)
Format
initialize
in class Format
public boolean equals(Object other)
Format
equals
in class Format
Object newInstance(EntityInput input, boolean rawAccess)
Format
newInstance
in class Format
Object newArray(int len)
Format
newArray
in class Format
void writeObject(Object o, EntityOutput output, boolean rawAccess)
Format
writeObject
in class Format
void readObject(Object o, EntityInput input, boolean rawAccess)
Format
readObject
in class Format
boolean isPriKeyNullOrZero(Object o, boolean rawAccess)
Format
isPriKeyNullOrZero
in class Format
void writePriKey(Object o, EntityOutput output, boolean rawAccess)
Format
writePriKey
in class Format
void readPriKey(Object o, EntityInput input, boolean rawAccess)
Format
readPriKey
in class Format
boolean nullifySecKey(Catalog catalog, Object entity, String keyName, Object keyElement)
Format
nullifySecKey
in class Format
void skipContents(EntityInput input)
Format
skipContents
in class Format
void copySecMultiKey(EntityInput input, Format keyFormat, Set results)
Format
copySecMultiKey
in class Format
Format skipToSecKey(EntityInput input, String keyName)
Format
skipToSecKey
in class Format
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |