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.
  • Method Details

    • getSession

      public Session getSession()
      Description copied from interface: DatabaseObject
      Retrieve the session owning the given schema object.
      Specified by:
      getSession in interface DatabaseObject
      Returns:
      Session
    • getSchema

      public Schema getSchema()
      Description copied from interface: DatabaseObject
      Retrieve the schema owning this database object.
      Specified by:
      getSchema in interface DatabaseObject
      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 interface DatabaseObject
      Returns:
      name
    • existsInDatabase

      public DatabaseObject.DbObjectStatus existsInDatabase()
      Description copied from interface: DatabaseObject
      Query the existence of this database object.
      Specified by:
      existsInDatabase in interface DatabaseObject
      Returns:
      DatabaseObject.DbObjectStatus
    • getCollections

      public java.util.List<Collection> getCollections()
      Description copied from interface: Schema
      Retrieve the set of collections existing in this schema.
      Specified by:
      getCollections in interface Schema
      Returns:
      list of Collection objects
    • getCollections

      public java.util.List<Collection> getCollections​(java.lang.String pattern)
      Description copied from interface: Schema
      Retrieve the set of collections existing in this schema and matching the given pattern.
      Specified by:
      getCollections in interface Schema
      Parameters:
      pattern - match pattern
      Returns:
      list of Collection objects
    • getTables

      public java.util.List<Table> getTables()
      Description copied from interface: Schema
      Retrieve the set of tables existing in this schema.
      Specified by:
      getTables in interface Schema
      Returns:
      list of Table objects
    • getTables

      public java.util.List<Table> getTables​(java.lang.String pattern)
      Description copied from interface: Schema
      Retrieve the set of tables existing in this schema and matching the given pattern.
      Specified by:
      getTables in interface Schema
      Parameters:
      pattern - match pattern
      Returns:
      list of Table objects
    • getCollection

      public Collection getCollection​(java.lang.String collectionName)
      Description copied from interface: Schema
      Retrieve a reference to the named collection.
      Specified by:
      getCollection in interface Schema
      Parameters:
      collectionName - collection name
      Returns:
      Collection
    • getCollection

      public Collection getCollection​(java.lang.String collectionName, boolean requireExists)
      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 interface Schema
      Parameters:
      collectionName - collection name
      requireExists - true if required to exist
      Returns:
      Collection
    • getCollectionAsTable

      public Table getCollectionAsTable​(java.lang.String collectionName)
      Description copied from interface: Schema
      Retrieve a reference to the named collection using the table API.
      Specified by:
      getCollectionAsTable in interface Schema
      Parameters:
      collectionName - collection name
      Returns:
      Table
    • getTable

      public Table getTable​(java.lang.String tableName)
      Description copied from interface: Schema
      Retrieve a reference to the named table.
      Specified by:
      getTable in interface Schema
      Parameters:
      tableName - table name
      Returns:
      Table
    • getTable

      public Table getTable​(java.lang.String tableName, boolean requireExists)
      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.
      Specified by:
      getTable in interface Schema
      Parameters:
      tableName - table name
      requireExists - true if required to exist
      Returns:
      Table
    • createCollection

      public Collection createCollection​(java.lang.String collectionName)
      Description copied from interface: Schema
      Create a new collection.
      Specified by:
      createCollection in interface Schema
      Parameters:
      collectionName - collection name
      Returns:
      Collection
    • createCollection

      public Collection createCollection​(java.lang.String collectionName, boolean reuseExisting)
      Description copied from interface: Schema
      Create a new collection if it does not already exist on the server.
      Specified by:
      createCollection in interface Schema
      Parameters:
      collectionName - collection name
      reuseExisting - 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 interface Schema
      Parameters:
      collectionName - collection name
      options - 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 interface Schema
      Parameters:
      collectionName - collection name
      options - validation level and JSON schema options
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.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 interface Schema
      Parameters:
      collectionName - name of collection to drop