public interface Schema extends DatabaseObject
Modifier and Type | Interface and Description |
---|---|
static class |
Schema.CreateCollectionOptions
Defines options to be passed to
createCollection(String, CreateCollectionOptions) . |
static class |
Schema.ModifyCollectionOptions
Defines options to be passed to
modifyCollection(String, ModifyCollectionOptions) . |
static class |
Schema.Validation
Validation options to be passed to
createCollection(String, CreateCollectionOptions) or
modifyCollection(String, ModifyCollectionOptions) . |
DatabaseObject.DbObjectStatus, DatabaseObject.DbObjectType
Modifier and Type | Method and Description |
---|---|
Collection |
createCollection(java.lang.String name)
Create a new collection.
|
Collection |
createCollection(java.lang.String name,
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.
|
Collection |
getCollection(java.lang.String name)
Retrieve a reference to the named collection.
|
Collection |
getCollection(java.lang.String name,
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 name)
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.
|
Table |
getTable(java.lang.String name)
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.
|
void |
modifyCollection(java.lang.String collectionName,
Schema.ModifyCollectionOptions options)
Modify the schema validation of a collection.
|
existsInDatabase, getName, getSchema, getSession
java.util.List<Collection> getCollections()
Collection
objectsjava.util.List<Collection> getCollections(java.lang.String pattern)
pattern
- match patternCollection
objectsjava.util.List<Table> getTables()
Table
objectsjava.util.List<Table> getTables(java.lang.String pattern)
pattern
- match patternTable
objectsCollection getCollection(java.lang.String name)
name
- collection nameCollection
Collection getCollection(java.lang.String name, boolean requireExists)
name
- collection namerequireExists
- true if required to existCollection
Table getCollectionAsTable(java.lang.String name)
name
- collection nameTable
Table getTable(java.lang.String name)
name
- table nameTable
Table getTable(java.lang.String tableName, boolean requireExists)
tableName
- table namerequireExists
- true if required to existTable
Collection createCollection(java.lang.String name)
name
- collection nameCollection
Collection createCollection(java.lang.String name, boolean reuseExisting)
name
- collection namereuseExisting
- true if allowed to reuseCollection
Collection createCollection(java.lang.String collectionName, Schema.CreateCollectionOptions options)
collectionName
- collection nameoptions
- reuseExisting, validation level and JSON schema optionsCollection
void modifyCollection(java.lang.String collectionName, Schema.ModifyCollectionOptions options)
collectionName
- collection nameoptions
- validation level and JSON schema optionsvoid dropCollection(java.lang.String collectionName)
collectionName
- name of collection to drop