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.DbObjectType
Nested classes/interfaces inherited from interface com.mysql.cj.xdevapi.Schema
Schema.CreateCollectionOptions, Schema.ModifyCollectionOptions, Schema.Validation
-
Method Summary
Modifier and Type Method 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()
-
Method Details
-
getSession
Description copied from interface:DatabaseObject
Retrieve the session owning the given schema object.- Specified by:
getSession
in interfaceDatabaseObject
- Returns:
Session
-
getSchema
Description copied from interface:DatabaseObject
Retrieve the schema owning this database object.- Specified by:
getSchema
in interfaceDatabaseObject
- Returns:
Schema
-
getName
public java.lang.String getName()Description copied from interface:DatabaseObject
Retrieve the name of the database object represented by the Java object.- Specified by:
getName
in interfaceDatabaseObject
- Returns:
- name
-
existsInDatabase
Description copied from interface:DatabaseObject
Query the existence of this database object.- Specified by:
existsInDatabase
in interfaceDatabaseObject
- Returns:
DatabaseObject.DbObjectStatus
-
getCollections
Description copied from interface:Schema
Retrieve the set of collections existing in this schema.- Specified by:
getCollections
in interfaceSchema
- Returns:
- list of
Collection
objects
-
getCollections
Description copied from interface:Schema
Retrieve the set of collections existing in this schema and matching the given pattern.- Specified by:
getCollections
in interfaceSchema
- Parameters:
pattern
- match pattern- Returns:
- list of
Collection
objects
-
getTables
Description copied from interface:Schema
Retrieve the set of tables existing in this schema. -
getTables
Description copied from interface:Schema
Retrieve the set of tables existing in this schema and matching the given pattern. -
getCollection
Description copied from interface:Schema
Retrieve a reference to the named collection.- Specified by:
getCollection
in interfaceSchema
- Parameters:
collectionName
- collection name- Returns:
Collection
-
getCollection
Description copied from interface:Schema
Retrieve a reference to the named collection hinting that an exception should be thrown if the collection is not known to the server.- Specified by:
getCollection
in interfaceSchema
- Parameters:
collectionName
- collection namerequireExists
- true if required to exist- Returns:
Collection
-
getCollectionAsTable
Description copied from interface:Schema
Retrieve a reference to the named collection using the table API.- Specified by:
getCollectionAsTable
in interfaceSchema
- Parameters:
collectionName
- collection name- Returns:
Table
-
getTable
Description copied from interface:Schema
Retrieve a reference to the named table. -
getTable
Description copied from interface:Schema
Retrieve 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:Schema
Create a new collection.- Specified by:
createCollection
in interfaceSchema
- Parameters:
collectionName
- collection name- Returns:
Collection
-
createCollection
Description copied from interface:Schema
Create a new collection if it does not already exist on the server.- Specified by:
createCollection
in 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:Schema
Create a new collection.- Specified by:
createCollection
in 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:Schema
Modify the schema validation of a collection.- Specified by:
modifyCollection
in interfaceSchema
- Parameters:
collectionName
- collection nameoptions
- validation level and JSON schema options
-
equals
public boolean equals(java.lang.Object other)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
dropCollection
public void dropCollection(java.lang.String collectionName)Description copied from interface:Schema
Drop the collection from this schema.- Specified by:
dropCollection
in interfaceSchema
- Parameters:
collectionName
- name of collection to drop
-