public interface OClass extends Comparable<OClass>
Modifier and Type | Interface and Description |
---|---|
static class |
OClass.ATTRIBUTES |
static class |
OClass.INDEX_TYPE |
Modifier and Type | Field and Description |
---|---|
static String |
EDGE_CLASS_NAME |
static String |
VERTEX_CLASS_NAME |
Modifier and Type | Method and Description |
---|---|
OClass |
addCluster(String iClusterName) |
OClass |
addClusterId(int iId) |
OClass |
addSuperClass(OClass superClass) |
boolean |
areIndexed(Collection<String> fields)
Indicates whether given fields are contained as first key fields in class indexes.
|
boolean |
areIndexed(String... fields) |
void |
clearCustom() |
long |
count()
Returns the number of the records of this class considering also subclasses (polymorphic).
|
long |
count(boolean iPolymorphic)
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 iName,
String iType,
OProgressListener iProgressListener,
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 iUnsafe)
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 iUnsafe)
Create a property in the class with the specified options.
|
Collection<OProperty> |
declaredProperties() |
void |
dropProperty(String iPropertyName) |
boolean |
existsProperty(String iPropertyName) |
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 iName)
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) |
Set<String> |
getCustomKeys() |
int |
getDefaultClusterId() |
String |
getDescription() |
Collection<OProperty> |
getIndexedProperties() |
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.
|
int[] |
getPolymorphicClusterIds() |
OProperty |
getProperty(String iPropertyName) |
String |
getShortName() |
long |
getSize() |
String |
getStreamableName() |
Collection<OClass> |
getSubclasses() |
OClass |
getSuperClass()
Deprecated.
|
List<OClass> |
getSuperClasses() |
List<String> |
getSuperClassesNames() |
boolean |
hasClusterId(int clusterId) |
boolean |
hasPolymorphicClusterId(int clusterId) |
boolean |
hasSuperClasses() |
boolean |
isAbstract() |
boolean |
isEdgeType() |
boolean |
isStrictMode() |
boolean |
isSubClassOf(OClass iClass)
Returns true if the current instance extends the passed schema class (iClass).
|
boolean |
isSubClassOf(String iClassName)
Tells if the current instance extends the passed schema class (iClass).
|
boolean |
isSuperClassOf(OClass iClass)
Returns true if the passed schema class (iClass) extends the current instance.
|
boolean |
isVertexType() |
Collection<OProperty> |
properties() |
Map<String,OProperty> |
propertiesMap() |
OClass |
removeClusterId(int iId) |
void |
removeCustom(String iName) |
OClass |
removeSuperClass(OClass superClass) |
OClass |
set(OClass.ATTRIBUTES attribute,
Object iValue) |
OClass |
setAbstract(boolean iAbstract) |
OClass |
setClusterSelection(OClusterSelectionStrategy clusterSelection) |
OClass |
setClusterSelection(String iStrategyName) |
OClass |
setCustom(String iName,
String iValue) |
void |
setDefaultClusterId(int iDefaultClusterId) |
OClass |
setDescription(String iDescription) |
OClass |
setName(String iName) |
OClass |
setOverSize(float overSize)
Sets the oversize factor.
|
OClass |
setShortName(String shortName) |
OClass |
setStrictMode(boolean iMode) |
OClass |
setSuperClass(OClass iSuperClass)
Deprecated.
|
OClass |
setSuperClasses(List<? extends OClass> classes) |
void |
truncate()
Truncates all the clusters the class uses.
|
OClass |
truncateCluster(String clusterName)
Removes all data in the cluster with given name.
|
compareTo
static final String EDGE_CLASS_NAME
static final String VERTEX_CLASS_NAME
boolean isAbstract()
OClass setAbstract(boolean iAbstract)
boolean isStrictMode()
OClass setStrictMode(boolean iMode)
@Deprecated OClass getSuperClass()
@Deprecated OClass setSuperClass(OClass iSuperClass)
boolean hasSuperClasses()
String getName()
String getDescription()
String getStreamableName()
Collection<OProperty> declaredProperties()
Collection<OProperty> properties()
Collection<OProperty> getIndexedProperties()
OProperty createProperty(String iPropertyName, OType iType, OClass iLinkedClass, boolean iUnsafe)
iPropertyName
- 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 nulliUnsafe
- if true avoid to check the persistent data for compatibility, should be used
only if all persistent data is compatible with the propertyOProperty createProperty(String iPropertyName, OType iType, OType iLinkedType, boolean iUnsafe)
iPropertyName
- 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 nulliUnsafe
- if true avoid to check the persistent data for compatibility, should be used
only if all persistent data is compatible with the propertyvoid dropProperty(String iPropertyName)
boolean existsProperty(String iPropertyName)
int getClusterForNewInstance(ODocument doc)
int getDefaultClusterId()
void setDefaultClusterId(int iDefaultClusterId)
int[] getClusterIds()
OClass addClusterId(int iId)
OClusterSelectionStrategy getClusterSelection()
OClass setClusterSelection(OClusterSelectionStrategy clusterSelection)
OClass truncateCluster(String clusterName)
clusterName
- Name of cluster to be truncated.OClass removeClusterId(int iId)
int[] getPolymorphicClusterIds()
@Deprecated Collection<OClass> getBaseClasses()
@Deprecated Collection<OClass> getAllBaseClasses()
Collection<OClass> getSubclasses()
Collection<OClass> getAllSubclasses()
Collection<OClass> getAllSuperClasses()
long getSize()
float getClassOverSize()
float getOverSize()
setOverSize(float)
OClass setOverSize(float overSize)
getOverSize()
long count()
long count(boolean iPolymorphic)
void truncate() throws IOException
IOException
boolean isSubClassOf(String iClassName)
iClassName
- isSuperClassOf(OClass)
boolean isSubClassOf(OClass iClass)
iClass
- isSuperClassOf(OClass)
boolean isSuperClassOf(OClass iClass)
iClass
- isSubClassOf(OClass)
String getShortName()
Object get(OClass.ATTRIBUTES iAttribute)
OClass set(OClass.ATTRIBUTES attribute, Object iValue)
OIndex createIndex(String iName, OClass.INDEX_TYPE iType, String... fields)
fields
- Field names from which index will be created.iName
- Database index nameiType
- Index type.OIndex createIndex(String iName, String iType, String... fields)
fields
- Field names from which index will be created.iName
- Database index nameiType
- Index type.OIndex createIndex(String iName, OClass.INDEX_TYPE iType, OProgressListener iProgressListener, String... fields)
fields
- Field names from which index will be created.iName
- Database index name.iType
- Index type.iProgressListener
- Progress listener.OIndex createIndex(String iName, String iType, OProgressListener iProgressListener, ODocument metadata, String algorithm, String... fields)
iName
- Database index name.iType
- Index type.iProgressListener
- 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.OIndex createIndex(String iName, String iType, OProgressListener iProgressListener, ODocument metadata, String... fields)
iName
- 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.Set<OIndex> getInvolvedIndexes(Collection<String> fields)
All 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.
fields
- Field names.OIndexDefinition.getParamCount()
Set<OIndex> getInvolvedIndexes(String... fields)
All 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.
fields
- Field names.getInvolvedIndexes(java.util.Collection)
Set<OIndex> getClassInvolvedIndexes(Collection<String> fields)
Indexes that related only to the given class will be returned.
fields
- Field names.OIndexDefinition.getParamCount()
Set<OIndex> getClassInvolvedIndexes(String... fields)
fields
- Field names.getClassInvolvedIndexes(java.util.Collection)
boolean areIndexed(Collection<String> fields)
fields
- Field names.true
if given fields are contained as first key fields in class indexes.boolean areIndexed(String... fields)
fields
- Field names.true
if given fields are contained as first key fields in class indexes.areIndexed(java.util.Collection)
OIndex getClassIndex(String iName)
iName
- Database index name.Set<OIndex> getClassIndexes()
void getClassIndexes(Collection<OIndex> indexes)
void getIndexes(Collection<OIndex> indexes)
OIndex getAutoShardingIndex()
boolean isEdgeType()
boolean isVertexType()
void removeCustom(String iName)
void clearCustom()
boolean hasClusterId(int clusterId)
boolean hasPolymorphicClusterId(int clusterId)
Copyright © 2009–2020 OrientDB. All rights reserved.