public interface Table
Modifier and Type | Method and Description |
---|---|
OutputStream |
createBlob(Tuple tuple,
String fieldName)
Creates a blob for the given tuple and field.
|
Tuple |
createTuple()
Creates an empty tuple with the list of fields of the table format, including the primary key
fields.
|
TupleKey |
createTupleKey()
Creates an empty key with the list of fields of the table pk.
|
Tuple |
createUpdateTuple()
Creates an empty tuple with all the fields defined as a Ignore.
|
Table |
delete(TupleKey tupleKey)
Deletes an existing tuple given its key.
|
void |
deleteBlob(Tuple tuple,
String fieldName)
Deletes the content of a blob field.
|
int |
deleteTuples(Filter filter)
Deletes the tuples that matches a given filter
|
TupleIterable |
find()
EntryPoint to run queries over the table.
|
Tuple |
get(TupleKey key)
Retrieves a single tuple from a given key.
|
Tuple |
get(TupleKey key,
Projection projection)
Retrieves a single projected tuple from a given key.
|
InputStream |
getBlob(Tuple tuple,
String fieldName)
Provides access to the blob storage of the given tuple and field.
|
String |
getName()
Getter method for name property.
|
TableModel |
getTableModel()
Getter method for tableModel property.
|
boolean |
hasConstraint(Constraint constraint)
Returns if a given constraint exists
|
Table |
insert(Tuple tuple)
Inserts a new tuple into the table.
|
Table |
truncate()
Truncates the table.
|
Table |
update(Tuple tuple)
Updates an existing tuple.
|
OutputStream |
updateBlob(Tuple tuple,
String fieldName)
Creates a new blob storage for an existing tuple and field.
|
Table |
upsert(Tuple tuple)
Updates or inserts a tuple.
|
TableModel getTableModel()
String getName()
TupleIterable find()
Tuple get(TupleKey key)
key
- Key of the tuple to be retrieved.Tuple get(TupleKey key, Projection projection)
key
- Key of the tuple to be retrieved.projection
- Projectin to be applied over the tuple if the returned tuple is not null.TupleKey createTupleKey()
Tuple createTuple()
Tuple createUpdateTuple()
Table insert(Tuple tuple)
tuple
- A new Tuple object with the appropriate format for this table (should be created with createTuple()
method).IllegalStateException
- if the method is called outside a transaction.IllegalArgumentException
- if the tuple exists.Table update(Tuple tuple)
tuple
- Tuple representing an existing (and possibly modified) tuple.IllegalStateException
- if the method is called outside a transaction.Table upsert(Tuple tuple)
tuple
- Tuple to be stored in the table.IllegalStateException
- if the method is called outside a transaction.Table delete(TupleKey tupleKey)
tupleKey
- Key of the tuple to be deleted.IllegalStateException
- if the method is called outside a transaction.int deleteTuples(Filter filter)
filter
- Filter which defines the tuples to be deleted. Can be null to delete te complete tableIllegalStateException
- if the method is called outside a transaction.Table truncate()
OutputStream createBlob(Tuple tuple, String fieldName)
tuple
- Tuple for which the blob is createdfieldName
- Name of the blob field to be filled.NotCompatibleTableModelException
- If does not exist a field with fieldName in the tupleClassCastException
- If Type of field fieldName is not BLOBOutputStream updateBlob(Tuple tuple, String fieldName)
tuple
- Tuple for which the blob is createdfieldName
- Name of the blob field to be filled.NotCompatibleTableModelException
- If does not exist a field with fieldName in the tupleClassCastException
- If Type of field fieldName is not BLOBInputStream getBlob(Tuple tuple, String fieldName)
tuple
- Tuple which contains the blobfieldName
- name of the blob fieldNotCompatibleTableModelException
- If does not exist a field with fieldName in the tupleClassCastException
- If Type of field fieldName is not BLOBvoid deleteBlob(Tuple tuple, String fieldName)
tuple
- Tuple to delete the blobfieldName
- blob field name to delete.NotCompatibleTableModelException
- If does not exist a field named fieldName in the tupleClassCastException
- If Type of field fieldName is not BLOBboolean hasConstraint(Constraint constraint)
constraint
- Constraint object to checkCopyright © 2020. All rights reserved.