org.neodatis.odb.core.layers.layer3
Interface IObjectReader

All Known Implementing Classes:
ObjectReader, ServerObjectReader

public interface IObjectReader


Method Summary
 java.lang.Object buildOneInstance(NonNativeObjectInfo objectInfo)
           
 void close()
           
 java.util.List<FullIDInfo> getAllIdInfos(java.lang.String objectTypeToDisplay, byte idType, boolean displayObject)
           
 java.util.List<java.lang.Long> getAllIds(byte idType)
          Returns information about all OIDs of the database
 java.lang.String getBaseIdentification()
           
 OID getIdOfObjectAt(long position, boolean includeDeleted)
          Returns the id of an object by reading the object header
 IInstanceBuilder getInstanceBuilder()
           
 OID getNextObjectOID(OID oid)
          Gets the next object oid of the object with the specific oid
 java.lang.Object getObjectFromOid(OID oid, boolean returnInstance, boolean useCache)
           
<T> Objects<T>
getObjectInfos(IQuery query, boolean inMemory, int startIndex, int endIndex, boolean returnObjects, IMatchingObjectAction queryResultAction)
          Return Objects.
 long getObjectPositionFromItsOid(OID oid, boolean useCache, boolean throwException)
          Gets the real object position from its OID
<T> Objects<T>
getObjects(IQuery query, boolean inMemory, int startIndex, int endIndex)
          Get a list of object matching the query
 Values getValues(IValuesQuery query, int startIndex, int endIndex)
          Get a list of values matching the query
 AtomicNativeObjectInfo readAtomicNativeObjectInfo(long position, int odbTypeId)
           
 java.lang.Object readAtomicNativeObjectInfoAsObject(long position, int odbTypeId)
           
 IOdbList<ClassInfoIndex> readClassInfoIndexesAt(long position, ClassInfo classInfo)
           
 void readDatabaseHeader(java.lang.String user, java.lang.String password)
          Reads the database header
 MetaModel readMetaModel(MetaModel metaModel, boolean full)
          Reads the database meta model
 NonNativeObjectInfo readNonNativeObjectInfoFromOid(ClassInfo classInfo, OID oid, boolean useCache, boolean returnObjects)
           
 NonNativeObjectInfo readNonNativeObjectInfoFromPosition(ClassInfo classInfo, OID oid, long position, boolean useCache, boolean returnInstance)
          Reads a non non native Object Info (Layer2) from its position
 ObjectInfoHeader readObjectInfoHeaderFromOid(OID oid, boolean useCache)
          Reads the pointers(ids or positions) of an object that has the specific oid
 AttributeValuesMap readObjectInfoValuesFromOID(ClassInfo classInfo, OID oid, boolean useCache, IOdbList<java.lang.String> attributeNames, IOdbList<java.lang.String> relationAttributeNames, int recursionLevel, java.lang.String[] orderByFields, boolean useOidForObject)
          reads some attributes of an object.
 long readOidPosition(OID oid)
           
 

Method Detail

readDatabaseHeader

void readDatabaseHeader(java.lang.String user,
                        java.lang.String password)
Reads the database header

Parameters:
user -
password -

readMetaModel

MetaModel readMetaModel(MetaModel metaModel,
                        boolean full)
Reads the database meta model

Parameters:
metaModel - An empty meta model
full - To indicate if a full read must be done
Returns:
The modified metamodel

readClassInfoIndexesAt

IOdbList<ClassInfoIndex> readClassInfoIndexesAt(long position,
                                                ClassInfo classInfo)

readNonNativeObjectInfoFromOid

NonNativeObjectInfo readNonNativeObjectInfoFromOid(ClassInfo classInfo,
                                                   OID oid,
                                                   boolean useCache,
                                                   boolean returnObjects)

readObjectInfoValuesFromOID

AttributeValuesMap readObjectInfoValuesFromOID(ClassInfo classInfo,
                                               OID oid,
                                               boolean useCache,
                                               IOdbList<java.lang.String> attributeNames,
                                               IOdbList<java.lang.String> relationAttributeNames,
                                               int recursionLevel,
                                               java.lang.String[] orderByFields,
                                               boolean useOidForObject)
reads some attributes of an object.
     example of method call
     readObjectInfoValues(classinfo,18000,true,["profile.name","profile.email"],["profile.name","profile.email"],0)
     readObjectInfoValues(classinfo,21789,true,["name"],["profile.name"],1)
 

Parameters:
classInfo - If null, we are probably reading a native instance : String for example
oid - The oid of the object to read. if -1,the read will be done by position
useCache - To indicate if cache must be used. If not, the old version of the object will read
attributeNames - The names of attributes to read the values, an attributename can contain relation like profile.name
relationAttributeNames - The original names of attributes to read the values, an attributename can contain relation like profile.name
recursionLevel - The recursion level of this method call
orderByFields -
useOidForObject - To indicate that if the object being read has an attribute that is not native, we will put the oid of the attribute (object) instead of reading the whole object
Returns:
The map with attribute values

readAtomicNativeObjectInfoAsObject

java.lang.Object readAtomicNativeObjectInfoAsObject(long position,
                                                    int odbTypeId)

readAtomicNativeObjectInfo

AtomicNativeObjectInfo readAtomicNativeObjectInfo(long position,
                                                  int odbTypeId)

readOidPosition

long readOidPosition(OID oid)

getObjectFromOid

java.lang.Object getObjectFromOid(OID oid,
                                  boolean returnInstance,
                                  boolean useCache)

getAllIdInfos

java.util.List<FullIDInfo> getAllIdInfos(java.lang.String objectTypeToDisplay,
                                         byte idType,
                                         boolean displayObject)

getIdOfObjectAt

OID getIdOfObjectAt(long position,
                    boolean includeDeleted)
Returns the id of an object by reading the object header

Parameters:
position -
includeDeleted -
Returns:
The oid of the object at the specific position

close

void close()

buildOneInstance

java.lang.Object buildOneInstance(NonNativeObjectInfo objectInfo)

getObjects

<T> Objects<T> getObjects(IQuery query,
                          boolean inMemory,
                          int startIndex,
                          int endIndex)
Get a list of object matching the query

Parameters:
query -
inMemory -
startIndex -
endIndex -
Returns:
The list of objects

getValues

Values getValues(IValuesQuery query,
                 int startIndex,
                 int endIndex)
Get a list of values matching the query

Parameters:
query -
startIndex -
endIndex -
Returns:
The list of values

getObjectInfos

<T> Objects<T> getObjectInfos(IQuery query,
                              boolean inMemory,
                              int startIndex,
                              int endIndex,
                              boolean returnObjects,
                              IMatchingObjectAction queryResultAction)
Return Objects. Match the query without instantiating objects. Only instantiate object for object that match the query

Parameters:
query - The query to select objects
inMemory - To indicate if object must be all loaded in memory
startIndex - First object index
endIndex - Last object index
returnObjects - To indicate if object instances must be created
Returns:
The list of objects

getBaseIdentification

java.lang.String getBaseIdentification()

getInstanceBuilder

IInstanceBuilder getInstanceBuilder()

readObjectInfoHeaderFromOid

ObjectInfoHeader readObjectInfoHeaderFromOid(OID oid,
                                             boolean useCache)
Reads the pointers(ids or positions) of an object that has the specific oid

Parameters:
oid - The oid of the object we want to read the pointers
Returns:
The ObjectInfoHeader

getAllIds

java.util.List<java.lang.Long> getAllIds(byte idType)
Returns information about all OIDs of the database

Parameters:
idType -
Returns:

getNextObjectOID

OID getNextObjectOID(OID oid)
Gets the next object oid of the object with the specific oid

Parameters:
oid -
Returns:
The oid of the next object. If there is no next object, return null

getObjectPositionFromItsOid

long getObjectPositionFromItsOid(OID oid,
                                 boolean useCache,
                                 boolean throwException)
Gets the real object position from its OID

Parameters:
oid - The oid of the object to get the position To indicate if an exception must be thrown if object is not found
Returns:
The object position, if object has been marked as deleted then return StorageEngineConstant.DELETED_OBJECT_POSITION

readNonNativeObjectInfoFromPosition

NonNativeObjectInfo readNonNativeObjectInfoFromPosition(ClassInfo classInfo,
                                                        OID oid,
                                                        long position,
                                                        boolean useCache,
                                                        boolean returnInstance)
Reads a non non native Object Info (Layer2) from its position

Parameters:
classInfo -
oid - can be null
position -
useCache -
returnInstance -
Returns:
The meta representation of the object