Package com.arcadedb.database
Class BaseDocument
- java.lang.Object
-
- com.arcadedb.database.BaseRecord
-
- com.arcadedb.database.BaseDocument
-
- All Implemented Interfaces:
Document
,Identifiable
,Record
,Externalizable
,Serializable
- Direct Known Subclasses:
ImmutableDocument
,MutableDocument
public abstract class BaseDocument extends BaseRecord implements Document, Serializable, Externalizable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
propertiesStartingPosition
protected DocumentType
type
-
Fields inherited from class com.arcadedb.database.BaseRecord
buffer, database, rid
-
Fields inherited from interface com.arcadedb.database.Document
RECORD_TYPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseDocument(Database database, DocumentType type, RID rid, Binary buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
asDocument()
Returns the document record.Document
asDocument(boolean loadContent)
Returns the document record.DetachedDocument
detach()
Boolean
getBoolean(String propertyName)
Byte
getByte(String propertyName)
Date
getDate(String propertyName)
BigDecimal
getDecimal(String propertyName)
Double
getDouble(String propertyName)
EmbeddedDocument
getEmbedded(String propertyName)
Float
getFloat(String propertyName)
Integer
getInteger(String propertyName)
Long
getLong(String propertyName)
byte
getRecordType()
Short
getShort(String propertyName)
String
getString(String propertyName)
DocumentType
getType()
String
getTypeName()
void
readExternal(ObjectInput in)
void
reload()
void
writeExternal(ObjectOutput out)
-
Methods inherited from class com.arcadedb.database.BaseRecord
asEdge, asEdge, asVertex, asVertex, delete, equals, getBuffer, getDatabase, getIdentity, getRecord, getRecord, hashCode, setBuffer, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.arcadedb.database.Document
get, getPropertyNames, has, modify, toJSON, toMap
-
Methods inherited from interface com.arcadedb.database.Identifiable
asEdge, asEdge, asVertex, asVertex, getRecord, getRecord
-
Methods inherited from interface com.arcadedb.database.Record
delete, getDatabase, getIdentity
-
-
-
-
Field Detail
-
type
protected final DocumentType type
-
propertiesStartingPosition
protected int propertiesStartingPosition
-
-
Constructor Detail
-
BaseDocument
protected BaseDocument(Database database, DocumentType type, RID rid, Binary buffer)
-
-
Method Detail
-
asDocument
public Document asDocument()
Description copied from interface:Identifiable
Returns the document record. If the record is not a document, a UnsupportedOperationException exception is thrown.- Specified by:
asDocument
in interfaceDocument
- Specified by:
asDocument
in interfaceIdentifiable
- Overrides:
asDocument
in classBaseRecord
- Returns:
- the
Document
-
asDocument
public Document asDocument(boolean loadContent)
Description copied from interface:Identifiable
Returns the document record. If the record is not a document, a UnsupportedOperationException exception is thrown.- Specified by:
asDocument
in interfaceDocument
- Specified by:
asDocument
in interfaceIdentifiable
- Overrides:
asDocument
in classBaseRecord
- Parameters:
loadContent
- specifies if pre-load the record content- Returns:
- the
Document
-
detach
public DetachedDocument detach()
-
getBoolean
public Boolean getBoolean(String propertyName)
- Specified by:
getBoolean
in interfaceDocument
-
getInteger
public Integer getInteger(String propertyName)
- Specified by:
getInteger
in interfaceDocument
-
getDecimal
public BigDecimal getDecimal(String propertyName)
- Specified by:
getDecimal
in interfaceDocument
-
getEmbedded
public EmbeddedDocument getEmbedded(String propertyName)
- Specified by:
getEmbedded
in interfaceDocument
-
getType
public DocumentType getType()
-
getTypeName
public String getTypeName()
- Specified by:
getTypeName
in interfaceDocument
-
getRecordType
public byte getRecordType()
- Specified by:
getRecordType
in interfaceRecord
-
reload
public void reload()
- Specified by:
reload
in interfaceRecord
- Overrides:
reload
in classBaseRecord
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
-