public class CompositeKeyFormat extends 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_NUMBER, ID_OBJECT, ID_PREDEFINED, ID_SHORT, ID_SHORT_W, ID_SIMPLE_MAX, ID_SIMPLE_MIN, ID_STRING
Constructor and Description |
---|
CompositeKeyFormat(Catalog catalog,
java.lang.Class cls,
ClassMetadata metadata,
java.util.List<FieldMetadata> fieldMeta)
Creates a new composite key format.
|
CompositeKeyFormat(Catalog catalog,
java.lang.Class cls,
java.lang.String[] fieldNames)
Reconsistitues a composite key format after a PersistComparator is
deserialized.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
collectRelatedFormats(Catalog catalog,
java.util.Map<java.lang.String,Format> newFormats)
Calls catalog.createFormat for formats that this format depends on, or
that should also be persistent.
|
(package private) java.lang.Object |
convertRawObject(Catalog catalog,
boolean rawAccess,
RawObject rawObject,
IdentityHashMap converted)
Converts a RawObject to a current class object and adds the converted
pair to the converted map.
|
(package private) void |
copySecKey(RecordInput input,
RecordOutput output)
Called after skipToSecKey() to copy the data bytes of a singular
(XXX_TO_ONE) key field.
|
(package private) boolean |
evolve(Format newFormatParam,
Evolver evolver)
Called for an existing format that may not equal the current format for
the same class.
|
ClassMetadata |
getClassMetadata()
Returns the original model class metadata used to create this class, or
null if this is not a model class.
|
(package private) java.util.List<FieldInfo> |
getFieldInfo() |
(package private) static java.lang.String[] |
getFieldNameArray(java.util.List<FieldMetadata> list) |
java.util.Map<java.lang.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) Format |
getSequenceKeyFormat()
Validates and returns the simple integer key format for a sequence key
associated with this format.
|
(package private) void |
initialize(Catalog catalog,
EntityModel model,
int initVersion)
Initializes an uninitialized format, initializing its related formats
(superclass formats and array component formats) first.
|
(package private) boolean |
isModelClass()
Returns whether this class is present in the EntityModel.
|
(package private) void |
migrateFromBeta(java.util.Map<java.lang.String,Format> formatMap)
Special handling for JE 3.0.12 beta formats.
|
(package private) java.lang.Object |
newArray(int len)
Creates an array of the format's class of the given length, as if
Array.newInstance(getType(), len) were called.
|
java.lang.Object |
newInstance(EntityInput input,
boolean rawAccess)
Creates a new instance of the target class using its default
constructor.
|
java.lang.Object |
readObject(java.lang.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 |
skipContents(RecordInput input)
Skips over the object's contents, as if readObject() were called, but
without returning an object.
|
(package private) void |
writeObject(java.lang.Object o,
EntityOutput output,
boolean rawAccess)
Writes a given instance of the target class to the output data bytes.
|
allowEvolveFromProxy, areNestedRefsProhibited, copySecMultiKey, evolveMetadata, getAccessor, getCatalog, getClassName, getComponentType, getDimensions, getEntityFormat, getEntityMetadata, getEnumConstants, getEvolveNeeded, getExistingType, getId, getLatestVersion, getNewStringFormat, getOldKeyName, getPreviousVersion, getProxiedFormat, getReader, getSuperFormat, getSuperType, getType, getVersion, getWrapperFormat, initCatalog, initializeIfNeeded, initializeReader, isArray, isAssignableTo, isCurrentVersion, isDeleted, isEntity, isEnum, isInitialized, isNew, isPredefined, isPriKeyNullOrZero, isPrimitive, isSameClass, isSimple, nullifySecKey, readPriKey, setDeleted, setEvolveNeeded, setId, setLatestVersion, setProxiedFormat, setReader, setSuperFormat, setUnused, skipToSecKey, toString, writePriKey
CompositeKeyFormat(Catalog catalog, java.lang.Class cls, ClassMetadata metadata, java.util.List<FieldMetadata> fieldMeta)
CompositeKeyFormat(Catalog catalog, java.lang.Class cls, java.lang.String[] fieldNames)
static java.lang.String[] getFieldNameArray(java.util.List<FieldMetadata> list)
java.util.List<FieldInfo> getFieldInfo()
void migrateFromBeta(java.util.Map<java.lang.String,Format> formatMap)
Format
migrateFromBeta
in class Format
boolean isModelClass()
Format
isModelClass
in class Format
public ClassMetadata getClassMetadata()
RawType
getClassMetadata
in interface RawType
getClassMetadata
in class Format
public java.util.Map<java.lang.String,RawField> getFields()
RawType
void collectRelatedFormats(Catalog catalog, java.util.Map<java.lang.String,Format> newFormats)
Format
collectRelatedFormats
in class Format
void initialize(Catalog catalog, EntityModel model, int initVersion)
Format
initialize
in class Format
java.lang.Object newArray(int len)
Format
public java.lang.Object newInstance(EntityInput input, boolean rawAccess)
Format
newInstance
in interface Reader
newInstance
in class Format
public java.lang.Object readObject(java.lang.Object o, EntityInput input, boolean rawAccess) throws RefreshException
Format
readObject
in interface Reader
readObject
in class Format
RefreshException
void writeObject(java.lang.Object o, EntityOutput output, boolean rawAccess) throws RefreshException
Format
writeObject
in class Format
RefreshException
java.lang.Object convertRawObject(Catalog catalog, boolean rawAccess, RawObject rawObject, IdentityHashMap converted) throws RefreshException
Format
convertRawObject
in class Format
RefreshException
void skipContents(RecordInput input) throws RefreshException
Format
skipContents
in class Format
RefreshException
void copySecKey(RecordInput input, RecordOutput output)
Format
copySecKey
in class Format
Format getSequenceKeyFormat()
Format
getSequenceKeyFormat
in class Format
boolean evolve(Format newFormatParam, Evolver evolver)
Format
If this method returns true, then it must have determined one of two things: - that the old and new formats are equal, and it must have called Evolver.useOldFormat; or - that the old format can be evolved to the new format, and it must have called Evolver.useEvolvedFormat.
If this method returns false, then it must have determined that the old format could not be evolved to the new format, and it must have called Evolver.addInvalidMutation, addMissingMutation or addEvolveError.
Copyright (c) 2004-2012 Oracle. All rights reserved.