Package oracle.soda
Interface OracleCollectionAdmin
-
public interface OracleCollectionAdmin
Provides DDL and metadata methods for theOracleCollection
administration: index creation and destruction, collection deletion (ie "drop"), metadata information about the collection, etc.An
OracleCollectionAdmin
object is associated with a particularOracleCollection
object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createIndex(OracleDocument indexSpecification)
Create an index using an index specification (expressed in JSON).void
createJsonSearchIndex(String indexName)
Turns on Json Search Index.void
drop()
Drops the collection.void
drop(boolean purge, boolean dropMappedObject)
Drops the collection.void
dropIndex(String indexName)
Drops the named index.void
dropIndex(String indexName, boolean force)
Drops the named index.OracleDocument
getDataGuide()
Returns a JSON data guide for the collection.String
getDBObjectName()
Returns the name of the table or view backing the collection.String
getDBObjectSchemaName()
Returns the name of the schema that owns the table or view backing the collection.OracleDocument
getMetadata()
Returns collection metadata expressed in JSON.String
getName()
Gets the collection's name.boolean
isHeterogeneous()
Indicates whether the collection can store non-JSON data.boolean
isReadOnly()
Indicates whether the collection is read-only.void
truncate()
Deletes all documents in the collection.
-
-
-
Method Detail
-
getName
String getName()
Gets the collection's name.- Returns:
- collection name as a
String
-
drop
void drop() throws OracleException
Drops the collection.- Throws:
OracleException
- if an error occurs while dropping the collection
-
drop
void drop(boolean purge, boolean dropMappedObject) throws OracleException
Drops the collection. Passingfalse
forpurge
andfalse
fordropMappedObject
is equivalent to invokingdrop()
.- Parameters:
purge
- set totrue
to release the space associated with the table underlying the collection. If set totrue
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 withpurge
set totrue
. Settingpurge
totrue
is only supported if the Oracle Database release is 21c or above.dropMappedObject
- set totrue
to drop the object (table or view) underlying the mapped collection. If set tofalse
the object underlying the mapped collection will not be dropped. SettingdropMappedObject
totrue
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 dropforce
- 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 benull
- Throws:
OracleException
- if (1) the index specification isnull
, 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 benull
- 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
-
-