JULEA
|
#include <julea-config.h>
#include <glib.h>
#include <string.h>
#include <bson.h>
#include <julea.h>
#include <db/jdb-internal.h>
#include <julea-db.h>
Functions | |
JDBEntry * | j_db_entry_new (JDBSchema *schema, GError **error) |
JDBEntry * | j_db_entry_ref (JDBEntry *entry) |
void | j_db_entry_unref (JDBEntry *entry) |
gboolean | j_db_entry_set_field (JDBEntry *entry, gchar const *name, gconstpointer value, guint64 length, GError **error) |
gboolean | j_db_entry_insert (JDBEntry *entry, JBatch *batch, GError **error) |
gboolean | j_db_entry_update (JDBEntry *entry, JDBSelector *selector, JBatch *batch, GError **error) |
gboolean | j_db_entry_delete (JDBEntry *entry, JDBSelector *selector, JBatch *batch, GError **error) |
gboolean | j_db_entry_get_id (JDBEntry *entry, gpointer *value, guint64 *length, GError **error) |
gboolean j_db_entry_delete | ( | JDBEntry * | entry, |
JDBSelector * | selector, | ||
JBatch * | batch, | ||
GError ** | error | ||
) |
Delete the entry from the backend.
The entry must not be modified until the batch is executed. The selector must not be modified until the batch is executed.
[in] | entry | specifies the schema to use |
[in] | selector | the selector defines what should be deleted |
[in] | batch | the batch to append this operation to |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
gboolean j_db_entry_get_id | ( | JDBEntry * | entry, |
gpointer * | value, | ||
guint64 * | length, | ||
GError ** | error | ||
) |
returns the id of the entry, after j_db_entry_insert has been called
[in] | entry | A JDBEntry. |
[out] | value | The id of entry . Should be freed using g_free(). |
[out] | length | The length of the id in byte. |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
Save the entry in the backend. All variables defined in the schema, which are not explicitily set, are initialized to NULL.
The entry must not be modified until the batch is executed.
[in] | entry | the entry to save |
[in] | batch | the batch to append this operation to |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
Allocates a new entry.
[in] | schema | The schema defines the structure of the entity |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
Increase the ref_count of the given entry.
[in] | entry | the entry to increase the ref_count |
gboolean j_db_entry_set_field | ( | JDBEntry * | entry, |
gchar const * | name, | ||
gconstpointer | value, | ||
guint64 | length, | ||
GError ** | error | ||
) |
Set a field in the given entry
[in] | entry | the entry to set a value |
[in] | name | the name to set a value |
[in] | value | the value to set |
[in] | length | the length of the value. Only used if the value-type defined in the Schema is binary. |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
void j_db_entry_unref | ( | JDBEntry * | entry | ) |
Decrease the ref_count of the given entry - and automatically call free if ref_count is 0. This is a noop if entry == NULL.
[in] | entry | the entry to decrease the ref_count |
gboolean j_db_entry_update | ( | JDBEntry * | entry, |
JDBSelector * | selector, | ||
JBatch * | batch, | ||
GError ** | error | ||
) |
Replayes all entrys attributes with the given entrys attributes in the backend where the selector matches.
The entry must not be modified until the batch is executed. The selector must not be modified until the batch is executed.
[in] | entry | the entry defining the final values of all matched entrys |
[in] | selector | the selector defines which entrys should be modifies |
[in] | batch | the batch to append this operation to |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |