public interface OracleCollection
Modifier and Type | Method and Description |
---|---|
OracleCollectionAdmin |
admin()
Gets an
OracleCollectionAdmin object |
OracleOperationBuilder |
find()
Returns an
OracleOperationBuilder representing
an operation that finds all documents in the collection. |
OracleDocument |
findOne(java.lang.String key)
Finds an
OracleDocument matching a key. |
void |
insert(java.util.Iterator<OracleDocument> documents)
Inserts multiple documents into the collection.
|
void |
insert(OracleDocument document)
Inserts a document into the collection.
|
java.util.List<OracleDocument> |
insertAndGet(java.util.Iterator<OracleDocument> documents)
Inserts multiple documents into the collection.
|
java.util.List<OracleDocument> |
insertAndGet(java.util.Iterator<OracleDocument> documents,
java.util.Map<java.lang.String,?> options)
Inserts multiple documents into the collection with options.
|
OracleDocument |
insertAndGet(OracleDocument document)
Inserts a document into the collection.
|
OracleDocument |
insertAndGet(OracleDocument document,
java.util.Map<java.lang.String,?> options)
Inserts a document into the collection.
|
void |
save(OracleDocument document)
Saves a document into the collection.
|
OracleDocument |
saveAndGet(OracleDocument document)
Saves a document into the collection.
|
OracleDocument |
saveAndGet(OracleDocument document,
java.util.Map<java.lang.String,?> options)
Saves a document into the collection.
|
OracleOperationBuilder find()
OracleOperationBuilder
representing
an operation that finds all documents in the collection.OracleOperationBuilder
OracleDocument findOne(java.lang.String key) throws OracleException
OracleDocument
matching a key.
This is a convenience method. The same operation can be
expressed as: col.find().key("k1").getOne()
key
- the key. Cannot be null
OracleDocument
matching the key.
null
if not found.OracleException
- if the key is null
void insert(OracleDocument document) throws OracleException
The key will be automatically created, unless this collection is configured with client-assigned keys and the key is provided in the input document.
document
- input document. Cannot have a
key if the collection is
configured to auto-generate keys. Cannot
be null
OracleException
- if (1) the input document
is null
, or (2) keys are
client-assigned for this
collection, but the key is not provided
in the input document, or (3) keys are
client-assigned for this collection, and
the key provided in the input document
already exists in the collection, or
(4) keys are auto-generated for this collection,
and the key is provided in the input document,
or (5) an error during insertion occursOracleDocument insertAndGet(OracleDocument document) throws OracleException
The key will be automatically created, unless this collection is configured with client-assigned keys and the key is provided in the input document.
document
- input document. Cannot have a
key if the collection is
configured to auto-generate keys. Cannot
be null
OracleException
- if (1) the input document
is null
, or (2) keys are
client-assigned for this
collection, but the key is not provided
in the input document, or (3) keys are
client-assigned for this collection, and
the key provided in the input document
already exists in the collection, or
(4) keys are auto-generated for this collection,
and the key is provided in the input document,
or (5) an error during insertion occursOracleDocument insertAndGet(OracleDocument document, java.util.Map<java.lang.String,?> options) throws OracleException
The key will be automatically created, unless this collection is configured with client-assigned keys and the key is provided in the input document.
document
- input document. Cannot have a
key if the collection is
configured to auto-generate keys. Cannot
be null
options
- null
or a Map
of options.
The key is option name and the value is the option
value. The semantics of the options are implementation
defined. The "hint" is a valid key with string value
containing one or more insert hints.OracleException
- if (1) the input document
is null
, or (2) keys are
client-assigned for this
collection, but the key is not provided
in the input document, or (3) keys are
client-assigned for this collection, and
the key provided in the input document
already exists in the collection, or
(4) keys are auto-generated for this collection,
and the key is provided in the input document,
or (5) an error during insertion occurs or
(6) the value of the hint supplied through options
is not of string type or contains substring "/*" or "*/"void save(OracleDocument document) throws OracleException
insert(OracleDocument)
except that
if client-assigned keys are used, and the document with
the specified key already exists in the collection, it
will be replaced with the input document.
The key will be automatically created, unless this collection is configured with client-assigned keys and the key is provided in the input document.
document
- input document. Cannot have a
key if the collection is
configured to auto-generate keys. Cannot
be null
OracleException
- if (1) the input document
is
null
, or (2) keys are client-assigned
for this collection, but the key is not provided
in the input document, or
(3) keys are auto-generated for this collection,
and the key is provided in the input document,
or (4) an error during insertion occursOracleDocument saveAndGet(OracleDocument document) throws OracleException
insertAndGet(OracleDocument)
except that
if client-assigned keys are used, and the document with
the specified key already exists in the collection, it
will be replaced with the input document.
The key will be automatically created, unless this collection is configured with client-assigned keys and the key is provided in the input document.
document
- input document. Cannot have a
key if the collection is
configured to auto-generate keys.
Cannot be null
OracleException
- if (1) the input document
is
null
, or (2) keys are client-assigned
for this collection, but the key is not provided
in the input document, or (3) keys are auto-generated
for this collection, and the key is provided in the input
document, or (4) an error during insertion occursOracleDocument saveAndGet(OracleDocument document, java.util.Map<java.lang.String,?> options) throws OracleException
insertAndGet(OracleDocument)
except that
if client-assigned keys are used, and the document with
the specified key already exists in the collection, it
will be replaced with the input document.
The key will be automatically created, unless this collection is configured with client-assigned keys and the key is provided in the input document.
document
- input document. Cannot have a
key if the collection is
configured to auto-generate keys.
Cannot be null
options
- null
or a Map
of options.
The key is option name and the value is the option
value. The semantics of the options are implementation
defined. The "hint" is a valid key with string value
containing one or more save hints.OracleException
- if (1) the input document
is
null
, or (2) keys are client-assigned
for this collection, but the key is not provided
in the input document, or (3) keys are auto-generated
for this collection, and the key is provided in the input
document, or (4) an error during insertion occurs
or (5) the value of the hint supplied through options
is not of string type or contains substring "/*" or "*/"void insert(java.util.Iterator<OracleDocument> documents) throws OracleBatchException
The keys will be automatically created, unless this collection has client-assigned keys and the key is provided in the input document.
If there is an error inserting one of the documents,
OracleBatchException
will be thrown. Invoking
OracleBatchException.getProcessed()
method
returns the number of document processed successfully
before the error occurred.
documents
- an Iterator
over input documents.
Cannot be null
.
Documents cannot have key
s
if the collection is configured to
auto-generate keys.OracleBatchException
- if (1) the input documents
Iterator
is null
,
or (2) keys are client-assigned for this
collection, but the key is not provided
for one or more of the input documents,
or (3) keys are client-assigned for this
collection, and the key provided for one
or more of the input documents already
exists in the collection, or (4) keys are
auto-generated for this collection,
but the key is provided in one or more
input documents, or (5) if an error
during insertion occursjava.util.List<OracleDocument> insertAndGet(java.util.Iterator<OracleDocument> documents) throws OracleBatchException
The keys will be automatically created, unless this collection has client-assigned keys and the key is provided in the input document.
If there is an error inserting one of the documents,
OracleBatchException
will be thrown. Invoking
OracleBatchException.getProcessedCount()
method
returns the number of document processed successfully
before the error occurred.
documents
- an iterator over input documents.
Cannot be null
.
Documents cannot have key
s
if the collection is configured to
auto-generate keysOracleBatchException
- if (1) the input documents
Iterator
is null
,
or (2) keys are client-assigned for this
collection, but the key is not provided
for one or more of the input documents,
or (3) keys are client-assigned for this
collection, and the key provided for one
or more of the input documents already
exists in the collection, or (4) keys are
auto-generated for this collection,
but the key is provided in one or more
input documents, or (5) if an error
during insertion occursjava.util.List<OracleDocument> insertAndGet(java.util.Iterator<OracleDocument> documents, java.util.Map<java.lang.String,?> options) throws OracleBatchException
The keys will be automatically created, unless this collection has client-assigned keys and the key is provided in the input document.
If there is an error inserting one of the documents,
OracleBatchException
will be thrown. Invoking
OracleBatchException.getProcessedCount()
method
returns the number of document processed successfully
before the error occurred.
documents
- an iterator over input documents.
Cannot be null
.
Documents cannot have key
s
if the collection is configured to
auto-generate keysoptions
- null
or a Map
of options.
The key is option name and the value is the option
value. The semantics of the options are implementation
defined. The "hint" is a valid key with string value
containing one or more insert hints.OracleBatchException
- if (1) the input documents
Iterator
is null
,
or (2) keys are client-assigned for this
collection, but the key is not provided
for one or more of the input documents,
or (3) keys are client-assigned for this
collection, and the key provided for one
or more of the input documents already
exists in the collection, or (4) keys are
auto-generated for this collection,
but the key is provided in one or more
input documents, or (5) if an error
during insertion occurs or (6) the value
of the hint supplied through options
is not of string type or contains substring
"/*" or "*/"OracleCollectionAdmin admin()
OracleCollectionAdmin
objectOracleCollectionAdmin
object