org.neodatis.odb.core.layers.layer3
Interface IObjectReader
-
- All Known Implementing Classes:
- ObjectReader, ServerObjectReader
public interface IObjectReader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.lang.ObjectbuildOneInstance(NonNativeObjectInfo objectInfo)voidclose()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 databasejava.lang.StringgetBaseIdentification()OIDgetIdOfObjectAt(long position, boolean includeDeleted)Returns the id of an object by reading the object headerIInstanceBuildergetInstanceBuilder()OIDgetNextObjectOID(OID oid)Gets the next object oid of the object with the specific oidjava.lang.ObjectgetObjectFromOid(OID oid, boolean returnInstance, boolean useCache)<T> Objects<T>getObjectInfos(IQuery query, boolean inMemory, int startIndex, int endIndex, boolean returnObjects, IMatchingObjectAction queryResultAction)Return Objects.longgetObjectPositionFromItsOid(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 queryValuesgetValues(IValuesQuery query, int startIndex, int endIndex)Get a list of values matching the queryAtomicNativeObjectInforeadAtomicNativeObjectInfo(long position, int odbTypeId)java.lang.ObjectreadAtomicNativeObjectInfoAsObject(long position, int odbTypeId)IOdbList<ClassInfoIndex>readClassInfoIndexesAt(long position, ClassInfo classInfo)voidreadDatabaseHeader(java.lang.String user, java.lang.String password)Reads the database headerMetaModelreadMetaModel(MetaModel metaModel, boolean full)Reads the database meta modelNonNativeObjectInforeadNonNativeObjectInfoFromOid(ClassInfo classInfo, OID oid, boolean useCache, boolean returnObjects)NonNativeObjectInforeadNonNativeObjectInfoFromPosition(ClassInfo classInfo, OID oid, long position, boolean useCache, boolean returnInstance)Reads a non non native Object Info (Layer2) from its positionObjectInfoHeaderreadObjectInfoHeaderFromOid(OID oid, boolean useCache)Reads the pointers(ids or positions) of an object that has the specific oidAttributeValuesMapreadObjectInfoValuesFromOID(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.longreadOidPosition(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 modelfull- 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 exampleoid- The oid of the object to read. if -1,the read will be done by positionuseCache- To indicate if cache must be used. If not, the old version of the object will readattributeNames- The names of attributes to read the values, an attributename can contain relation like profile.namerelationAttributeNames- The original names of attributes to read the values, an attributename can contain relation like profile.namerecursionLevel- The recursion level of this method callorderByFields-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 objectsinMemory- To indicate if object must be all loaded in memorystartIndex- First object indexendIndex- Last object indexreturnObjects- 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 nullposition-useCache-returnInstance-- Returns:
- The meta representation of the object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG