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(String name)
Create a new collection.
|
Collection |
createCollection(String name,
boolean reuseExisting)
Create a new collection if it does not already exist on the server.
|
Collection |
createCollection(String collectionName,
Schema.CreateCollectionOptions options)
Create a new collection.
|
void |
dropCollection(String collectionName)
Drop the collection from this schema.
|
Collection |
getCollection(String name)
Retrieve a reference to the named collection.
|
Collection |
getCollection(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(String name)
Retrieve a reference to the named collection using the table API.
|
List<Collection> |
getCollections()
Retrieve the set of collections existing in this schema.
|
List<Collection> |
getCollections(String pattern)
Retrieve the set of collections existing in this schema and matching the given pattern.
|
Table |
getTable(String name)
Retrieve a reference to the named table.
|
Table |
getTable(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.
|
List<Table> |
getTables()
Retrieve the set of tables existing in this schema.
|
List<Table> |
getTables(String pattern)
Retrieve the set of tables existing in this schema and matching the given pattern.
|
void |
modifyCollection(String collectionName,
Schema.ModifyCollectionOptions options)
Modify the schema validation of a collection.
|
existsInDatabase, getName, getSchema, getSession
List<Collection> getCollections()
Collection
objectsList<Collection> getCollections(String pattern)
pattern
- match patternCollection
objectsList<Table> getTables()
Table
objectsList<Table> getTables(String pattern)
pattern
- match patternTable
objectsCollection getCollection(String name)
name
- collection nameCollection
Collection getCollection(String name, boolean requireExists)
name
- collection namerequireExists
- true if required to existCollection
Table getCollectionAsTable(String name)
name
- collection nameTable
Table getTable(String name)
name
- table nameTable
Table getTable(String tableName, boolean requireExists)
tableName
- table namerequireExists
- true if required to existTable
Collection createCollection(String name)
name
- collection nameCollection
Collection createCollection(String name, boolean reuseExisting)
name
- collection namereuseExisting
- true if allowed to reuseCollection
Collection createCollection(String collectionName, Schema.CreateCollectionOptions options)
collectionName
- collection nameoptions
- reuseExisting, validation level and JSON schema optionsCollection
void modifyCollection(String collectionName, Schema.ModifyCollectionOptions options)
collectionName
- collection nameoptions
- validation level and JSON schema optionsvoid dropCollection(String collectionName)
collectionName
- name of collection to drop