public class PersistEntityBinding extends java.lang.Object implements EntityBinding
Modifier and Type | Field and Description |
---|---|
(package private) PersistCatalog |
catalog |
(package private) Format |
entityFormat |
(package private) PersistKeyAssigner |
keyAssigner |
(package private) boolean |
rawAccess |
Constructor and Description |
---|
PersistEntityBinding(PersistCatalog catalogParam,
java.lang.String entityClassName,
boolean rawAccess)
Creates a key binding for a given entity class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
entryToObject(DatabaseEntry key,
DatabaseEntry data)
Converts key and data entry buffers into an entity Object.
|
java.lang.Object |
entryToObjectWithPriKey(java.lang.Object priKey,
DatabaseEntry data)
This method will be used in PrimaryIndex.get, where the primary key is
known to DPL.
|
PersistKeyAssigner |
getKeyAssigner() |
(package private) static Format |
getOrCreateFormat(Catalog useCatalog,
java.lang.String clsName,
boolean rawAccess)
Utility method for getting or creating a format as appropriate for
bindings and key creators.
|
void |
objectToData(java.lang.Object entity,
DatabaseEntry data)
Extracts the data entry from an entity Object.
|
void |
objectToKey(java.lang.Object entity,
DatabaseEntry key)
Extracts the key entry from an entity Object.
|
(package private) static java.lang.Object |
readEntity(Catalog useCatalog,
DatabaseEntry key,
java.lang.Object priKey,
DatabaseEntry data,
boolean rawAccess)
Creates the instance, reads the entity key first to track visited
entities correctly, then reads the data and returns the entity.
|
(package private) void |
refresh(PersistCatalog newCatalog)
See Store.refresh.
|
(package private) static void |
writeEntity(Format format,
Catalog catalog,
java.lang.Object entity,
DatabaseEntry data,
boolean rawAccess)
Writes the formatId and object, and returns the bytes.
|
volatile PersistCatalog catalog
volatile Format entityFormat
final boolean rawAccess
PersistKeyAssigner keyAssigner
public PersistEntityBinding(PersistCatalog catalogParam, java.lang.String entityClassName, boolean rawAccess)
public PersistKeyAssigner getKeyAssigner()
public java.lang.Object entryToObject(DatabaseEntry key, DatabaseEntry data)
EntityBinding
entryToObject
in interface EntityBinding
key
- is the source key entry.data
- is the source data entry.public java.lang.Object entryToObjectWithPriKey(java.lang.Object priKey, DatabaseEntry data)
static java.lang.Object readEntity(Catalog useCatalog, DatabaseEntry key, java.lang.Object priKey, DatabaseEntry data, boolean rawAccess) throws RefreshException
RefreshException
public void objectToData(java.lang.Object entity, DatabaseEntry data)
EntityBinding
objectToData
in interface EntityBinding
entity
- is the source Object.data
- is the destination entry buffer.static void writeEntity(Format format, Catalog catalog, java.lang.Object entity, DatabaseEntry data, boolean rawAccess) throws RefreshException
RefreshException
public void objectToKey(java.lang.Object entity, DatabaseEntry key)
EntityBinding
objectToKey
in interface EntityBinding
entity
- is the source Object.key
- is the destination entry buffer.static Format getOrCreateFormat(Catalog useCatalog, java.lang.String clsName, boolean rawAccess) throws RefreshException
RefreshException
void refresh(PersistCatalog newCatalog)
Copyright (c) 2004-2012 Oracle. All rights reserved.