public class SchemaImpl extends java.lang.Object implements Schema
Schema
implementation.Schema.CreateCollectionOptions, Schema.ModifyCollectionOptions, Schema.Validation
DatabaseObject.DbObjectStatus, DatabaseObject.DbObjectType
Modifier and Type | Method and Description |
---|---|
Collection |
createCollection(java.lang.String collectionName)
Create a new collection.
|
Collection |
createCollection(java.lang.String collectionName,
boolean reuseExisting)
Create a new collection if it does not already exist on the server.
|
Collection |
createCollection(java.lang.String collectionName,
Schema.CreateCollectionOptions options)
Create a new collection.
|
void |
dropCollection(java.lang.String collectionName)
Drop the collection from this schema.
|
boolean |
equals(java.lang.Object other) |
DatabaseObject.DbObjectStatus |
existsInDatabase()
Query the existence of this database object.
|
Collection |
getCollection(java.lang.String collectionName)
Retrieve a reference to the named collection.
|
Collection |
getCollection(java.lang.String collectionName,
boolean requireExists)
Retrieve a reference to the named collection hinting that an exception should be thrown if the collection is not known to the server.
|
Table |
getCollectionAsTable(java.lang.String collectionName)
Retrieve a reference to the named collection using the table API.
|
java.util.List<Collection> |
getCollections()
Retrieve the set of collections existing in this schema.
|
java.util.List<Collection> |
getCollections(java.lang.String pattern)
Retrieve the set of collections existing in this schema and matching the given pattern.
|
java.lang.String |
getName()
Retrieve the name of the database object represented by the Java object.
|
Schema |
getSchema()
Retrieve the schema owning this database object.
|
Session |
getSession()
Retrieve the session owning the given schema object.
|
Table |
getTable(java.lang.String tableName)
Retrieve a reference to the named table.
|
Table |
getTable(java.lang.String tableName,
boolean requireExists)
Retrieve a reference to the named table hinting that an exception should be thrown if the collection is not known to the server.
|
java.util.List<Table> |
getTables()
Retrieve the set of tables existing in this schema.
|
java.util.List<Table> |
getTables(java.lang.String pattern)
Retrieve the set of tables existing in this schema and matching the given pattern.
|
int |
hashCode() |
void |
modifyCollection(java.lang.String collectionName,
Schema.ModifyCollectionOptions options)
Modify the schema validation of a collection.
|
java.lang.String |
toString() |
public Session getSession()
DatabaseObject
getSession
in interface DatabaseObject
Session
public Schema getSchema()
DatabaseObject
getSchema
in interface DatabaseObject
Schema
public java.lang.String getName()
DatabaseObject
getName
in interface DatabaseObject
public DatabaseObject.DbObjectStatus existsInDatabase()
DatabaseObject
existsInDatabase
in interface DatabaseObject
DatabaseObject.DbObjectStatus
public java.util.List<Collection> getCollections()
Schema
getCollections
in interface Schema
Collection
objectspublic java.util.List<Collection> getCollections(java.lang.String pattern)
Schema
getCollections
in interface Schema
pattern
- match patternCollection
objectspublic java.util.List<Table> getTables()
Schema
public java.util.List<Table> getTables(java.lang.String pattern)
Schema
public Collection getCollection(java.lang.String collectionName)
Schema
getCollection
in interface Schema
collectionName
- collection nameCollection
public Collection getCollection(java.lang.String collectionName, boolean requireExists)
Schema
getCollection
in interface Schema
collectionName
- collection namerequireExists
- true if required to existCollection
public Table getCollectionAsTable(java.lang.String collectionName)
Schema
getCollectionAsTable
in interface Schema
collectionName
- collection nameTable
public Table getTable(java.lang.String tableName)
Schema
public Table getTable(java.lang.String tableName, boolean requireExists)
Schema
public Collection createCollection(java.lang.String collectionName)
Schema
createCollection
in interface Schema
collectionName
- collection nameCollection
public Collection createCollection(java.lang.String collectionName, boolean reuseExisting)
Schema
createCollection
in interface Schema
collectionName
- collection namereuseExisting
- true if allowed to reuseCollection
public Collection createCollection(java.lang.String collectionName, Schema.CreateCollectionOptions options)
Schema
createCollection
in interface Schema
collectionName
- collection nameoptions
- reuseExisting, validation level and JSON schema optionsCollection
public void modifyCollection(java.lang.String collectionName, Schema.ModifyCollectionOptions options)
Schema
modifyCollection
in interface Schema
collectionName
- collection nameoptions
- validation level and JSON schema optionspublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void dropCollection(java.lang.String collectionName)
Schema
dropCollection
in interface Schema
collectionName
- name of collection to drop