Package oracle.soda

Interface OracleCollectionAdmin


  • public interface OracleCollectionAdmin
    Provides DDL and metadata methods for the OracleCollection administration: index creation and destruction, collection deletion (ie "drop"), metadata information about the collection, etc.

    An OracleCollectionAdmin object is associated with a particular OracleCollection object.

    • Method Detail

      • getName

        String getName()
        Gets the collection's name.
        Returns:
        collection name as a String
      • drop

        void drop​(boolean purge,
                  boolean dropMappedObject)
           throws OracleException
        Drops the collection. Passing false for purge and false for dropMappedObject is equivalent to invoking drop().
        Parameters:
        purge - set to true to release the space associated with the table underlying the collection. If set to true the database does not place the table backing the collection into the recycle bin. Note: you cannot recover the table if the collection was dropped with purge set to true. Setting purge to true is only supported if the Oracle Database release is 21c or above.
        dropMappedObject - set to true to drop the object (table or view) underlying the mapped collection. If set to false the object underlying the mapped collection will not be dropped. Setting dropMappedObject to true is only supported if the Oracle Database release is 21c or above.
        Throws:
        OracleException - if an error occurs while dropping the collection
      • truncate

        void truncate()
               throws OracleException
        Deletes all documents in the collection.
        Throws:
        OracleException - if an error occurs while truncating the collection
      • dropIndex

        void dropIndex​(String indexName)
                throws OracleException
        Drops the named index.
        Parameters:
        indexName - name of the index to drop
        Throws:
        OracleException - if an error occurs while dropping the index
      • dropIndex

        void dropIndex​(String indexName,
                       boolean force)
                throws OracleException
        Drops the named index.
        Parameters:
        indexName - name of the index to drop
        force - force index drop. Can only be used with json search or spatial indexes.
        Throws:
        OracleException - if an error occurs while dropping the index
      • createIndex

        void createIndex​(OracleDocument indexSpecification)
                  throws OracleException
        Create an index using an index specification (expressed in JSON).
        Parameters:
        indexSpecification - an index specification. Cannot be null
        Throws:
        OracleException - if (1) the index specification is null, or (2) an error occurs while dropping the index
      • createJsonSearchIndex

        void createJsonSearchIndex​(String indexName)
                            throws OracleException
        Turns on Json Search Index.
        Parameters:
        indexName - name of the index. Cannot be null
        Throws:
        OracleException - if an error occurs while creating the index
      • getDBObjectName

        String getDBObjectName()
        Returns the name of the table or view backing the collection.
        Returns:
        object name as a String
      • getDBObjectSchemaName

        String getDBObjectSchemaName()
        Returns the name of the schema that owns the table or view backing the collection.
        Returns:
        schema name as a String
      • isHeterogeneous

        boolean isHeterogeneous()
        Indicates whether the collection can store non-JSON data.
        Returns:
        true if the collection can store non-JSON data; false otherwise
      • isReadOnly

        boolean isReadOnly()
        Indicates whether the collection is read-only.
        Returns:
        true if the collection is read-only; false otherwise
      • getDataGuide

        OracleDocument getDataGuide()
                             throws OracleException
        Returns a JSON data guide for the collection. Requires 12.2.0.1 and above Oracle Database release.
        Returns:
        OracleDocument representing JSON data guide for the collection. null if the data guide is not available.
        Throws:
        OracleException - if an error occurs while fetching the JSON data guide.
      • getMetadata

        OracleDocument getMetadata()
        Returns collection metadata expressed in JSON.
        Returns:
        collection metadata in JSON