Package com.mysql.cj.xdevapi
Class SchemaImpl
java.lang.Object
com.mysql.cj.xdevapi.SchemaImpl
- All Implemented Interfaces:
DatabaseObject,Schema
public class SchemaImpl extends java.lang.Object implements Schema
Schema implementation.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mysql.cj.xdevapi.DatabaseObject
DatabaseObject.DbObjectStatus, DatabaseObject.DbObjectTypeNested classes/interfaces inherited from interface com.mysql.cj.xdevapi.Schema
Schema.CreateCollectionOptions, Schema.ModifyCollectionOptions, Schema.Validation -
Method Summary
Modifier and Type Method Description CollectioncreateCollection(java.lang.String collectionName)Create a new collection.CollectioncreateCollection(java.lang.String collectionName, boolean reuseExisting)Create a new collection if it does not already exist on the server.CollectioncreateCollection(java.lang.String collectionName, Schema.CreateCollectionOptions options)Create a new collection.voiddropCollection(java.lang.String collectionName)Drop the collection from this schema.booleanequals(java.lang.Object other)DatabaseObject.DbObjectStatusexistsInDatabase()Query the existence of this database object.CollectiongetCollection(java.lang.String collectionName)Retrieve a reference to the named collection.CollectiongetCollection(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.TablegetCollectionAsTable(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.StringgetName()Retrieve the name of the database object represented by the Java object.SchemagetSchema()Retrieve the schema owning this database object.SessiongetSession()Retrieve the session owning the given schema object.TablegetTable(java.lang.String tableName)Retrieve a reference to the named table.TablegetTable(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.inthashCode()voidmodifyCollection(java.lang.String collectionName, Schema.ModifyCollectionOptions options)Modify the schema validation of a collection.java.lang.StringtoString()
-
Method Details
-
getSession
Description copied from interface:DatabaseObjectRetrieve the session owning the given schema object.- Specified by:
getSessionin interfaceDatabaseObject- Returns:
Session
-
getSchema
Description copied from interface:DatabaseObjectRetrieve the schema owning this database object.- Specified by:
getSchemain interfaceDatabaseObject- Returns:
Schema
-
getName
public java.lang.String getName()Description copied from interface:DatabaseObjectRetrieve the name of the database object represented by the Java object.- Specified by:
getNamein interfaceDatabaseObject- Returns:
- name
-
existsInDatabase
Description copied from interface:DatabaseObjectQuery the existence of this database object.- Specified by:
existsInDatabasein interfaceDatabaseObject- Returns:
DatabaseObject.DbObjectStatus
-
getCollections
Description copied from interface:SchemaRetrieve the set of collections existing in this schema.- Specified by:
getCollectionsin interfaceSchema- Returns:
- list of
Collectionobjects
-
getCollections
Description copied from interface:SchemaRetrieve the set of collections existing in this schema and matching the given pattern.- Specified by:
getCollectionsin interfaceSchema- Parameters:
pattern- match pattern- Returns:
- list of
Collectionobjects
-
getTables
Description copied from interface:SchemaRetrieve the set of tables existing in this schema. -
getTables
Description copied from interface:SchemaRetrieve the set of tables existing in this schema and matching the given pattern. -
getCollection
Description copied from interface:SchemaRetrieve a reference to the named collection.- Specified by:
getCollectionin interfaceSchema- Parameters:
collectionName- collection name- Returns:
Collection
-
getCollection
Description copied from interface:SchemaRetrieve a reference to the named collection hinting that an exception should be thrown if the collection is not known to the server.- Specified by:
getCollectionin interfaceSchema- Parameters:
collectionName- collection namerequireExists- true if required to exist- Returns:
Collection
-
getCollectionAsTable
Description copied from interface:SchemaRetrieve a reference to the named collection using the table API.- Specified by:
getCollectionAsTablein interfaceSchema- Parameters:
collectionName- collection name- Returns:
Table
-
getTable
Description copied from interface:SchemaRetrieve a reference to the named table. -
getTable
Description copied from interface:SchemaRetrieve a reference to the named table hinting that an exception should be thrown if the collection is not known to the server. -
createCollection
Description copied from interface:SchemaCreate a new collection.- Specified by:
createCollectionin interfaceSchema- Parameters:
collectionName- collection name- Returns:
Collection
-
createCollection
Description copied from interface:SchemaCreate a new collection if it does not already exist on the server.- Specified by:
createCollectionin interfaceSchema- Parameters:
collectionName- collection namereuseExisting- true if allowed to reuse- Returns:
Collection
-
createCollection
public Collection createCollection(java.lang.String collectionName, Schema.CreateCollectionOptions options)Description copied from interface:SchemaCreate a new collection.- Specified by:
createCollectionin interfaceSchema- Parameters:
collectionName- collection nameoptions- reuseExisting, validation level and JSON schema options- Returns:
Collection
-
modifyCollection
public void modifyCollection(java.lang.String collectionName, Schema.ModifyCollectionOptions options)Description copied from interface:SchemaModify the schema validation of a collection.- Specified by:
modifyCollectionin interfaceSchema- Parameters:
collectionName- collection nameoptions- validation level and JSON schema options
-
equals
public boolean equals(java.lang.Object other)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
dropCollection
public void dropCollection(java.lang.String collectionName)Description copied from interface:SchemaDrop the collection from this schema.- Specified by:
dropCollectionin interfaceSchema- Parameters:
collectionName- name of collection to drop
-