public class OSchemaProxyObject extends Object implements OSchemaObject
Modifier and Type | Field and Description |
---|---|
protected OSchema |
underlying |
Constructor and Description |
---|
OSchemaProxyObject(OSchema iUnderlying) |
Modifier and Type | Method and Description |
---|---|
int |
countClasses() |
int |
countViews() |
void |
create() |
OClass |
createAbstractClass(Class<?> iClass) |
OClass |
createAbstractClass(String iClassName) |
OClass |
createAbstractClass(String iClassName,
OClass... superClasses) |
OClass |
createAbstractClass(String iClassName,
OClass iSuperClass) |
OClass |
createClass(Class<?> clazz) |
OClass |
createClass(String iClassName) |
OClass |
createClass(String className,
int[] clusterIds,
OClass... superClasses) |
OClass |
createClass(String className,
int clusters,
OClass... superClasses) |
OClass |
createClass(String iClassName,
OClass... superClasses) |
OClass |
createClass(String iClassName,
OClass iSuperClass) |
OClass |
createClass(String iClassName,
OClass iSuperClass,
int[] iClusterIds) |
OGlobalProperty |
createGlobalProperty(String name,
OType type,
Integer id) |
OView |
createView(ODatabaseDocumentInternal database,
String viewName,
String statement,
Map<String,Object> metadata) |
OView |
createView(OViewConfig config) |
OView |
createView(OViewConfig config,
ViewCreationListener listener) |
OView |
createView(String viewName,
String statement) |
void |
dropClass(String iClassName) |
void |
dropView(String name) |
boolean |
existsClass(String iClassName) |
boolean |
existsView(String name) |
protected static void |
generateLinkProperty(ODatabaseDocument database,
OClass schema,
String field,
OType t,
Class<?> linkedClazz) |
protected static void |
generateOClass(Class<?> iClass,
ODatabaseDocument database) |
void |
generateSchema(Class<?> iClass)
Generate/updates the SchemaClass and properties from given Class>.
|
void |
generateSchema(Class<?> iClass,
ODatabaseDocument database)
Generate/updates the SchemaClass and properties from given Class>.
|
void |
generateSchema(String iPackageName)
Scans all classes accessible from the context class loader which belong to the given package
and subpackages.
|
void |
generateSchema(String iPackageName,
ClassLoader iClassLoader)
Scans all classes accessible from the context class loader which belong to the given package
and subpackages.
|
OClass |
getClass(Class<?> iClass) |
OClass |
getClass(String iClassName)
Returns the OClass instance by class name.
|
OClass |
getClassByClusterId(int clusterId) |
Collection<OClass> |
getClasses() |
Set<OClass> |
getClassesRelyOnCluster(String iClusterName)
Returns all the classes that rely on a cluster
|
OClusterSelectionFactory |
getClusterSelectionFactory() |
List<OGlobalProperty> |
getGlobalProperties() |
OGlobalProperty |
getGlobalPropertyById(int id) |
ORID |
getIdentity() |
OClass |
getOrCreateClass(String iClassName) |
OClass |
getOrCreateClass(String iClassName,
OClass... superClasses) |
OClass |
getOrCreateClass(String iClassName,
OClass iSuperClass) |
OSchema |
getUnderlying() |
int |
getVersion()
Deprecated.
|
OView |
getView(String name) |
OView |
getViewByClusterId(int clusterId) |
Collection<OView> |
getViews() |
OImmutableSchema |
makeSnapshot() |
OSchema |
reload() |
void |
synchronizeSchema()
Checks if all registered entities has schema generated, if not it generates it
|
protected OSchema underlying
public OSchemaProxyObject(OSchema iUnderlying)
public OImmutableSchema makeSnapshot()
makeSnapshot
in interface OSchema
public int countClasses()
countClasses
in interface OSchema
public int countViews()
countViews
in interface OSchema
public OClass createClass(String iClassName)
createClass
in interface OSchema
public OClass createClass(String iClassName, OClass iSuperClass)
createClass
in interface OSchema
public OClass createClass(String iClassName, OClass... superClasses)
createClass
in interface OSchema
public OClass createClass(String iClassName, OClass iSuperClass, int[] iClusterIds)
createClass
in interface OSchema
public OClass createClass(String className, int[] clusterIds, OClass... superClasses)
createClass
in interface OSchema
public OClass createAbstractClass(Class<?> iClass)
createAbstractClass
in interface OSchemaObject
public OClass createAbstractClass(String iClassName)
createAbstractClass
in interface OSchema
public OClass createAbstractClass(String iClassName, OClass iSuperClass)
createAbstractClass
in interface OSchema
public OClass createAbstractClass(String iClassName, OClass... superClasses)
createAbstractClass
in interface OSchema
public boolean existsClass(String iClassName)
existsClass
in interface OSchema
public boolean existsView(String name)
existsView
in interface OSchema
public OClass getClass(String iClassName)
OSchema
If the class is not configured and the database has an entity manager with the requested class as registered, then creates a schema class for it at the fly.
If the database nor the entity manager have not registered class with specified name, returns null.
public OClass getOrCreateClass(String iClassName)
getOrCreateClass
in interface OSchema
public OClass getOrCreateClass(String iClassName, OClass iSuperClass)
getOrCreateClass
in interface OSchema
public OClass getOrCreateClass(String iClassName, OClass... superClasses)
getOrCreateClass
in interface OSchema
public OGlobalProperty getGlobalPropertyById(int id)
getGlobalPropertyById
in interface OSchema
public Collection<OClass> getClasses()
getClasses
in interface OSchema
public Collection<OView> getViews()
public OView createView(String viewName, String statement)
createView
in interface OSchema
public OView createView(ODatabaseDocumentInternal database, String viewName, String statement, Map<String,Object> metadata)
createView
in interface OSchema
public OView createView(OViewConfig config)
createView
in interface OSchema
public OView createView(OViewConfig config, ViewCreationListener listener)
createView
in interface OSchema
@Deprecated public int getVersion()
getVersion
in interface OSchema
public ORID getIdentity()
getIdentity
in interface OSchema
public Set<OClass> getClassesRelyOnCluster(String iClusterName)
OSchema
getClassesRelyOnCluster
in interface OSchema
iClusterName
- Cluster namepublic OClass createClass(String className, int clusters, OClass... superClasses)
createClass
in interface OSchema
public OSchema getUnderlying()
public OClass getClassByClusterId(int clusterId)
getClassByClusterId
in interface OSchema
public OView getViewByClusterId(int clusterId)
getViewByClusterId
in interface OSchema
public OClusterSelectionFactory getClusterSelectionFactory()
getClusterSelectionFactory
in interface OSchema
public void generateSchema(String iPackageName)
iPackageName
- The base packagepublic void generateSchema(String iPackageName, ClassLoader iClassLoader)
iPackageName
- The base packagepublic void generateSchema(Class<?> iClass)
iClass
- :- the Class> to generatepublic void generateSchema(Class<?> iClass, ODatabaseDocument database)
iClass
- :- the Class> to generatepublic void synchronizeSchema()
protected static void generateOClass(Class<?> iClass, ODatabaseDocument database)
protected static void generateLinkProperty(ODatabaseDocument database, OClass schema, String field, OType t, Class<?> linkedClazz)
public List<OGlobalProperty> getGlobalProperties()
getGlobalProperties
in interface OSchema
public OGlobalProperty createGlobalProperty(String name, OType type, Integer id)
createGlobalProperty
in interface OSchema
public OClass createClass(Class<?> clazz)
createClass
in interface OSchemaObject
Copyright © 2009–2020 OrientDB. All rights reserved.