
public abstract class OClassImpl extends ODocumentWrapperNoClass implements OClass
OClass.ATTRIBUTES, OClass.INDEX_TYPE| Modifier and Type | Field and Description |
|---|---|
protected boolean |
abstractClass |
protected int[] |
clusterIds |
protected OClusterSelectionStrategy |
clusterSelection |
protected Map<String,String> |
customFields |
protected int |
defaultClusterId |
protected String |
description |
protected int |
hashCode |
protected String |
name |
protected static int |
NOT_EXISTENT_CLUSTER_ID |
protected float |
overSize |
protected OSchemaShared |
owner |
protected int[] |
polymorphicClusterIds |
protected Map<String,OProperty> |
properties |
protected String |
shortName |
protected boolean |
strictMode |
protected List<OClass> |
subclasses |
protected List<OClassImpl> |
superClasses |
documentEDGE_CLASS_NAME, VERTEX_CLASS_NAME| Modifier | Constructor and Description |
|---|---|
protected |
OClassImpl(OSchemaShared iOwner,
ODocument iDocument,
String iName)
Constructor used in unmarshalling.
|
protected |
OClassImpl(OSchemaShared iOwner,
String iName)
Constructor used in unmarshalling.
|
protected |
OClassImpl(OSchemaShared iOwner,
String iName,
int[] iClusterIds) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireSchemaReadLock() |
void |
acquireSchemaWriteLock() |
protected OClass |
addBaseClass(OClassImpl iBaseClass)
Adds a base class to the current one.
|
static OClass |
addClusters(OClass cls,
int iClusters) |
protected void |
addPolymorphicClusterId(int clusterId) |
protected void |
addPolymorphicClusterIds(OClassImpl iBaseClass)
Add different cluster id to the "polymorphic cluster ids" array.
|
protected abstract OProperty |
addProperty(String propertyName,
OType type,
OType linkedType,
OClass linkedClass,
boolean unsafe) |
boolean |
areIndexed(Collection<String> fields)
Indicates whether given fields are contained as first key fields in class indexes.
|
boolean |
areIndexed(String... fields) |
protected void |
checkAllLikedObjects(ODatabaseInternal<ORecord> database,
String propertyName,
OType type,
OClass linkedClass) |
void |
checkEmbedded() |
protected static void |
checkParametersConflict(List<OClass> classes) |
protected void |
checkParametersConflict(OClass baseClass) |
void |
checkPersistentPropertyType(ODatabaseInternal<ORecord> database,
String propertyName,
OType type,
OClass linkedClass) |
int |
compareTo(OClass o) |
long |
count()
Returns the number of the records of this class considering also subclasses (polymorphic).
|
long |
count(boolean isPolymorphic)
Returns the number of the records of this class and based on polymorphic parameter it consider or not the subclasses.
|
OIndex<?> |
createIndex(String iName,
OClass.INDEX_TYPE iType,
OProgressListener iProgressListener,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String iName,
OClass.INDEX_TYPE iType,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String iName,
String iType,
OProgressListener iProgressListener,
ODocument metadata,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String name,
String type,
OProgressListener progressListener,
ODocument metadata,
String algorithm,
String... fields)
Creates database index that is based on passed in field names.
|
OIndex<?> |
createIndex(String iName,
String iType,
String... fields)
Creates database index that is based on passed in field names.
|
OProperty |
createProperty(String iPropertyName,
OType iType) |
OProperty |
createProperty(String iPropertyName,
OType iType,
OClass iLinkedClass) |
OProperty |
createProperty(String iPropertyName,
OType iType,
OClass iLinkedClass,
boolean unsafe)
Create a property in the class with the specified options.
|
OProperty |
createProperty(String iPropertyName,
OType iType,
OType iLinkedType) |
OProperty |
createProperty(String iPropertyName,
OType iType,
OType iLinkedType,
boolean unsafe)
Create a property in the class with the specified options.
|
protected abstract OPropertyImpl |
createPropertyInstance(ODocument p) |
Collection<OProperty> |
declaredProperties() |
static String |
decodeClassName(String s) |
boolean |
equals(Object obj) |
boolean |
existsProperty(String propertyName) |
List<OType> |
extractFieldTypes(String[] fieldNames) |
void |
fireDatabaseMigration(ODatabaseDocument database,
String propertyName,
OType type) |
void |
firePropertyNameMigration(ODatabaseDocument database,
String propertyName,
String newPropertyName,
OType type) |
void |
fromStream() |
Object |
get(OClass.ATTRIBUTES iAttribute) |
Collection<OClass> |
getAllBaseClasses()
Deprecated.
|
Collection<OClass> |
getAllSubclasses() |
Collection<OClass> |
getAllSuperClasses() |
OIndex<?> |
getAutoShardingIndex()
Returns the auto sharding index configured for the class if any.
|
Collection<OClass> |
getBaseClasses()
Deprecated.
|
OIndex<?> |
getClassIndex(String name)
Returns index instance by database index name.
|
Set<OIndex<?>> |
getClassIndexes() |
void |
getClassIndexes(Collection<OIndex<?>> indexes)
Internal.
|
Set<OIndex<?>> |
getClassInvolvedIndexes(Collection<String> fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
Set<OIndex<?>> |
getClassInvolvedIndexes(String... fields) |
float |
getClassOverSize() |
int |
getClusterForNewInstance(ODocument doc) |
int[] |
getClusterIds() |
OClusterSelectionStrategy |
getClusterSelection() |
String |
getCustom(String iName) |
Map<String,String> |
getCustomInternal() |
Set<String> |
getCustomKeys() |
protected ODatabaseDocumentInternal |
getDatabase() |
int |
getDefaultClusterId() |
String |
getDescription() |
protected String |
getEscapedName(String iName,
boolean iStrictSQL) |
Collection<OProperty> |
getIndexedProperties() |
void |
getIndexedProperties(Collection<OProperty> indexedProperties) |
Set<OIndex<?>> |
getIndexes() |
void |
getIndexes(Collection<OIndex<?>> indexes)
Internal.
|
Set<OIndex<?>> |
getInvolvedIndexes(Collection<String> fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
Set<OIndex<?>> |
getInvolvedIndexes(String... fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
String |
getName() |
float |
getOverSize()
Returns the oversize factor.
|
OSchemaShared |
getOwner() |
int[] |
getPolymorphicClusterIds() |
OProperty |
getProperty(String propertyName) |
String |
getShortName() |
long |
getSize() |
String |
getStreamableName() |
Collection<OClass> |
getSubclasses() |
OClass |
getSuperClass()
Deprecated.
|
List<OClass> |
getSuperClasses() |
List<String> |
getSuperClassesNames() |
boolean |
hasClusterId(int clusterId) |
int |
hashCode() |
boolean |
hasPolymorphicClusterId(int clusterId) |
boolean |
hasSuperClasses() |
boolean |
isAbstract() |
boolean |
isEdgeType() |
boolean |
isStrictMode() |
boolean |
isSubClassOf(OClass clazz)
Check if the current instance extends specified schema class.
|
boolean |
isSubClassOf(String iClassName)
Check if the current instance extends specified schema class.
|
boolean |
isSuperClassOf(OClass clazz)
Returns true if the passed schema class (iClass) extends the current instance.
|
boolean |
isVertexType() |
protected boolean |
matchesType(Object x,
OClass linkedClass) |
void |
onPostIndexManagement() |
Collection<OProperty> |
properties() |
Map<String,OProperty> |
propertiesMap() |
static int[] |
readableClusters(ODatabaseDocument db,
int[] iClusterIds) |
void |
releaseSchemaReadLock() |
void |
releaseSchemaWriteLock() |
void |
releaseSchemaWriteLock(boolean iSave) |
<RET extends ODocumentWrapper> |
reload() |
protected abstract OClass |
removeBaseClassInternal(OClass baseClass) |
void |
removeCustom(String name) |
protected void |
removePolymorphicClusterId(int clusterId) |
protected void |
removePolymorphicClusterIds(OClassImpl iBaseClass) |
protected void |
renameCluster(String oldName,
String newName) |
void |
renameProperty(String iOldName,
String iNewName) |
OClass |
set(OClass.ATTRIBUTES attribute,
Object iValue) |
protected OClass |
setClusterIds(int[] iClusterIds) |
OClass |
setClusterSelection(OClusterSelectionStrategy clusterSelection) |
void |
setClusterSelectionInternal(OClusterSelectionStrategy iClusterSelection) |
abstract OClassImpl |
setEncryption(String iValue) |
protected void |
setEncryptionInternal(ODatabaseDocumentInternal database,
String iValue) |
OClass |
setSuperClass(OClass iSuperClass)
Deprecated.
|
OClass |
setSuperClassesByNames(List<String> classNames) |
protected abstract void |
setSuperClassesInternal(List<? extends OClass> classes) |
ODocument |
toNetworkStream() |
ODocument |
toStream() |
String |
toString() |
void |
truncate()
Truncates all the clusters the class uses.
|
protected void |
validatePropertyName(String propertyName) |
fromStream, load, reload, save, savegetDocument, load, load, reloadclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddCluster, addClusterId, addSuperClass, clearCustom, dropProperty, removeClusterId, removeSuperClass, setAbstract, setClusterSelection, setCustom, setDefaultClusterId, setDescription, setName, setOverSize, setShortName, setStrictMode, setSuperClasses, truncateClusterprotected static final int NOT_EXISTENT_CLUSTER_ID
protected final OSchemaShared owner
protected int defaultClusterId
protected String name
protected String description
protected int[] clusterIds
protected List<OClassImpl> superClasses
protected int[] polymorphicClusterIds
protected float overSize
protected String shortName
protected boolean strictMode
protected boolean abstractClass
protected volatile OClusterSelectionStrategy clusterSelection
protected volatile int hashCode
protected OClassImpl(OSchemaShared iOwner, String iName)
protected OClassImpl(OSchemaShared iOwner, String iName, int[] iClusterIds)
protected OClassImpl(OSchemaShared iOwner, ODocument iDocument, String iName)
public static int[] readableClusters(ODatabaseDocument db, int[] iClusterIds)
public OClusterSelectionStrategy getClusterSelection()
getClusterSelection in interface OClasspublic OClass setClusterSelection(OClusterSelectionStrategy clusterSelection)
setClusterSelection in interface OClasspublic <RET extends ODocumentWrapper> RET reload()
reload in class ODocumentWrapperNoClasspublic void removeCustom(String name)
removeCustom in interface OClasspublic Set<String> getCustomKeys()
getCustomKeys in interface OClasspublic boolean hasClusterId(int clusterId)
hasClusterId in interface OClasspublic boolean hasPolymorphicClusterId(int clusterId)
hasPolymorphicClusterId in interface OClass@Deprecated public OClass getSuperClass()
getSuperClass in interface OClass@Deprecated public OClass setSuperClass(OClass iSuperClass)
setSuperClass in interface OClasspublic List<OClass> getSuperClasses()
getSuperClasses in interface OClasspublic boolean hasSuperClasses()
hasSuperClasses in interface OClasspublic List<String> getSuperClassesNames()
getSuperClassesNames in interface OClassprotected abstract void setSuperClassesInternal(List<? extends OClass> classes)
public String getShortName()
getShortName in interface OClasspublic String getDescription()
getDescription in interface OClasspublic String getStreamableName()
getStreamableName in interface OClasspublic Collection<OProperty> declaredProperties()
declaredProperties in interface OClasspublic Map<String,OProperty> propertiesMap()
propertiesMap in interface OClasspublic Collection<OProperty> properties()
properties in interface OClasspublic void getIndexedProperties(Collection<OProperty> indexedProperties)
public Collection<OProperty> getIndexedProperties()
getIndexedProperties in interface OClasspublic OProperty getProperty(String propertyName)
getProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType)
createProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType, OClass iLinkedClass)
createProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType, OClass iLinkedClass, boolean unsafe)
OClasscreateProperty in interface OClassiPropertyName - the name of the property.iType - the type of the property.iLinkedClass - in case of property of type LINK,LINKLIST,LINKSET,LINKMAP,EMBEDDED,EMBEDDEDLIST,EMBEDDEDSET,EMBEDDEDMAP can be
specified a linked class in all the other cases should be nullunsafe - if true avoid to check the persistent data for compatibility, should be used only if all persistent data is compatible
with the propertypublic OProperty createProperty(String iPropertyName, OType iType, OType iLinkedType)
createProperty in interface OClasspublic OProperty createProperty(String iPropertyName, OType iType, OType iLinkedType, boolean unsafe)
OClasscreateProperty in interface OClassiPropertyName - the name of the property.iType - the type of the property.iLinkedType - in case of property of type EMBEDDEDLIST,EMBEDDEDSET,EMBEDDEDMAP can be specified a linked type in all the other cases
should be nullunsafe - if true avoid to check the persistent data for compatibility, should be used only if all persistent data is compatible
with the propertypublic boolean existsProperty(String propertyName)
existsProperty in interface OClasspublic void fromStream()
fromStream in class ODocumentWrapperNoClassprotected abstract OPropertyImpl createPropertyInstance(ODocument p)
public ODocument toStream()
toStream in class ODocumentWrapperpublic int getClusterForNewInstance(ODocument doc)
getClusterForNewInstance in interface OClasspublic int getDefaultClusterId()
getDefaultClusterId in interface OClasspublic int[] getClusterIds()
getClusterIds in interface OClasspublic int[] getPolymorphicClusterIds()
getPolymorphicClusterIds in interface OClasspublic Collection<OClass> getSubclasses()
getSubclasses in interface OClasspublic Collection<OClass> getAllSubclasses()
getAllSubclasses in interface OClass@Deprecated public Collection<OClass> getBaseClasses()
getBaseClasses in interface OClass@Deprecated public Collection<OClass> getAllBaseClasses()
getAllBaseClasses in interface OClasspublic Collection<OClass> getAllSuperClasses()
getAllSuperClasses in interface OClasspublic float getOverSize()
OClassgetOverSize in interface OClassOClass.setOverSize(float)public float getClassOverSize()
getClassOverSize in interface OClasspublic boolean isAbstract()
isAbstract in interface OClasspublic boolean isStrictMode()
isStrictMode in interface OClasspublic String toString()
toString in class ODocumentWrapperpublic boolean equals(Object obj)
equals in class ODocumentWrapperpublic int hashCode()
hashCode in class ODocumentWrapperpublic int compareTo(OClass o)
compareTo in interface Comparable<OClass>public long count()
OClasspublic long count(boolean isPolymorphic)
OClasspublic void truncate()
throws IOException
truncate in interface OClassIOExceptionpublic boolean isSubClassOf(String iClassName)
isSubClassOf in interface OClassiClassName - of class that should be checkedisSuperClassOf(OClass)public boolean isSubClassOf(OClass clazz)
isSubClassOf in interface OClassclazz - to checkisSuperClassOf(OClass)public boolean isSuperClassOf(OClass clazz)
isSuperClassOf in interface OClassclazz - to checkisSubClassOf(OClass)public Object get(OClass.ATTRIBUTES iAttribute)
public OClass set(OClass.ATTRIBUTES attribute, Object iValue)
public abstract OClassImpl setEncryption(String iValue)
protected void setEncryptionInternal(ODatabaseDocumentInternal database, String iValue)
public OIndex<?> createIndex(String iName, OClass.INDEX_TYPE iType, String... fields)
OClasscreateIndex in interface OClassiName - Database index nameiType - Index type.fields - Field names from which index will be created.public OIndex<?> createIndex(String iName, String iType, String... fields)
OClasscreateIndex in interface OClassiName - Database index nameiType - Index type.fields - Field names from which index will be created.public OIndex<?> createIndex(String iName, OClass.INDEX_TYPE iType, OProgressListener iProgressListener, String... fields)
OClasscreateIndex in interface OClassiName - Database index name.iType - Index type.iProgressListener - Progress listener.fields - Field names from which index will be created.public OIndex<?> createIndex(String iName, String iType, OProgressListener iProgressListener, ODocument metadata, String... fields)
OClasscreateIndex in interface OClassiName - Database index name.iType - Index type.iProgressListener - Progress listener.metadata - Additional parameters which will be added in index configuration document as "metadata" field.fields - Field names from which index will be created. @return Class index registered inside of given class ans associated with
database index.public OIndex<?> createIndex(String name, String type, OProgressListener progressListener, ODocument metadata, String algorithm, String... fields)
OClasscreateIndex in interface OClassname - Database index name.type - Index type.progressListener - Progress listener.metadata - Additional parameters which will be added in index configuration document as "metadata" field.algorithm - Algorithm to use for indexing.fields - Field names from which index will be created. @return Class index registered inside of given class ans associated with
database index.public boolean areIndexed(String... fields)
areIndexed in interface OClassfields - Field names.true if given fields are contained as first key fields in class indexes.OClass.areIndexed(java.util.Collection)public boolean areIndexed(Collection<String> fields)
OClassareIndexed in interface OClassfields - Field names.true if given fields are contained as first key fields in class indexes.public Set<OIndex<?>> getInvolvedIndexes(String... fields)
OClassAll indexes sorted by their count of parameters in ascending order. If there are indexes for the given set of fields in super class they will be taken into account.
getInvolvedIndexes in interface OClassfields - Field names.OClass.getInvolvedIndexes(java.util.Collection)public Set<OIndex<?>> getInvolvedIndexes(Collection<String> fields)
OClassAll indexes sorted by their count of parameters in ascending order. If there are indexes for the given set of fields in super class they will be taken into account.
getInvolvedIndexes in interface OClassfields - Field names.OIndexDefinition.getParamCount()public Set<OIndex<?>> getClassInvolvedIndexes(Collection<String> fields)
OClassIndexes that related only to the given class will be returned.
getClassInvolvedIndexes in interface OClassfields - Field names.OIndexDefinition.getParamCount()public Set<OIndex<?>> getClassInvolvedIndexes(String... fields)
getClassInvolvedIndexes in interface OClassfields - Field names.OClass.getClassInvolvedIndexes(java.util.Collection)public OIndex<?> getClassIndex(String name)
OClassgetClassIndex in interface OClassname - Database index name.public Set<OIndex<?>> getClassIndexes()
getClassIndexes in interface OClasspublic void getClassIndexes(Collection<OIndex<?>> indexes)
OClassgetClassIndexes in interface OClasspublic OIndex<?> getAutoShardingIndex()
OClassgetAutoShardingIndex in interface OClasspublic boolean isEdgeType()
isEdgeType in interface OClasspublic boolean isVertexType()
isVertexType in interface OClasspublic void onPostIndexManagement()
public void getIndexes(Collection<OIndex<?>> indexes)
OClassgetIndexes in interface OClasspublic Set<OIndex<?>> getIndexes()
getIndexes in interface OClasspublic void acquireSchemaReadLock()
public void releaseSchemaReadLock()
public void acquireSchemaWriteLock()
public void releaseSchemaWriteLock()
public void releaseSchemaWriteLock(boolean iSave)
public void checkEmbedded()
public void setClusterSelectionInternal(OClusterSelectionStrategy iClusterSelection)
public void fireDatabaseMigration(ODatabaseDocument database, String propertyName, OType type)
public void firePropertyNameMigration(ODatabaseDocument database, String propertyName, String newPropertyName, OType type)
public void checkPersistentPropertyType(ODatabaseInternal<ORecord> database, String propertyName, OType type, OClass linkedClass)
protected void checkAllLikedObjects(ODatabaseInternal<ORecord> database, String propertyName, OType type, OClass linkedClass)
public OSchemaShared getOwner()
protected void addPolymorphicClusterId(int clusterId)
protected abstract OProperty addProperty(String propertyName, OType type, OType linkedType, OClass linkedClass, boolean unsafe)
protected void validatePropertyName(String propertyName)
protected OClass addBaseClass(OClassImpl iBaseClass)
iBaseClass - The base class to add.protected void checkParametersConflict(OClass baseClass)
protected void removePolymorphicClusterIds(OClassImpl iBaseClass)
protected void removePolymorphicClusterId(int clusterId)
protected ODatabaseDocumentInternal getDatabase()
protected void addPolymorphicClusterIds(OClassImpl iBaseClass)
protected OClass setClusterIds(int[] iClusterIds)
public ODocument toNetworkStream()
Copyright © 2009–2025 OrientDB. All rights reserved.