Package oracle.soda
Interface OracleCollectionAdmin
-
public interface OracleCollectionAdminProvides DDL and metadata methods for theOracleCollectionadministration: index creation and destruction, collection deletion (ie "drop"), metadata information about the collection, etc.An
OracleCollectionAdminobject is associated with a particularOracleCollectionobject.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreateIndex(OracleDocument indexSpecification)Create an index using an index specification (expressed in JSON).voidcreateJsonSearchIndex(String indexName)Turns on Json Search Index.voiddrop()Drops the collection.voiddrop(boolean purge, boolean dropMappedObject)Drops the collection.voiddropIndex(String indexName)Drops the named index.voiddropIndex(String indexName, boolean force)Drops the named index.OracleDocumentgetDataGuide()Returns a JSON data guide for the collection.StringgetDBObjectName()Returns the name of the table or view backing the collection.StringgetDBObjectSchemaName()Returns the name of the schema that owns the table or view backing the collection.OracleDocumentgetMetadata()Returns collection metadata expressed in JSON.StringgetName()Gets the collection's name.booleanisHeterogeneous()Indicates whether the collection can store non-JSON data.booleanisReadOnly()Indicates whether the collection is read-only.voidtruncate()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 OracleExceptionDrops the collection. PassingfalseforpurgeandfalsefordropMappedObjectis equivalent to invokingdrop().- Parameters:
purge- set totrueto release the space associated with the table underlying the collection. If set totruethe database does not place the table backing the collection into the recycle bin. Note: you cannot recover the table if the collection was dropped withpurgeset totrue. Settingpurgetotrueis only supported if the Oracle Database release is 21c or above.dropMappedObject- set totrueto drop the object (table or view) underlying the mapped collection. If set tofalsethe object underlying the mapped collection will not be dropped. SettingdropMappedObjecttotrueis 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 OracleExceptionDeletes 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:
trueif the collection can store non-JSON data;falseotherwise
-
isReadOnly
boolean isReadOnly()
Indicates whether the collection is read-only.- Returns:
trueif the collection is read-only;falseotherwise
-
getDataGuide
OracleDocument getDataGuide() throws OracleException
Returns a JSON data guide for the collection. Requires 12.2.0.1 and above Oracle Database release.- Returns:
OracleDocumentrepresenting JSON data guide for the collection.nullif 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
-
-