org.makumba.db
Class DataHolder

java.lang.Object
  extended by org.makumba.db.DataHolder

public class DataHolder
extends Object

Class which enables it to perform "super-CRUD" operations, i.e. composite inserts and updates on subrecords The data is passed as a dictionary, and its keys look like "a", "a.b", "a.b.c" ...

Version:
$Id: DBConnection.java 1938 2007-10-25 14:55:27Z manuel_gay $
Author:
Cristian Bogdan, Manuel Gay

Field Summary
(package private)  Hashtable<String,Object> dictionnary
          dictionary holding the data used for the operation, and on which operations are performed
(package private)  Hashtable<String,Object> sets
          dictionary holding the data which has to be performed on sets
(package private)  Hashtable<String,DataHolder> subrecords
          dictionary holding subrecords, i.e. each key gives access to a hashtable of fields
 
Constructor Summary
DataHolder(Transaction t, Dictionary<String,Object> data, String type)
           
 
Method Summary
 void checkInsert()
          Checks if it is possible to insert data for all subrecords.
(package private)  void checkUpdate(Pointer pointer)
          Checks if it is possible to update for all subrecords.
 Pointer insert()
           
 String toString()
           
(package private)  int update(Pointer p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dictionnary

Hashtable<String,Object> dictionnary
dictionary holding the data used for the operation, and on which operations are performed


subrecords

Hashtable<String,DataHolder> subrecords
dictionary holding subrecords, i.e. each key gives access to a hashtable of fields


sets

Hashtable<String,Object> sets
dictionary holding the data which has to be performed on sets

Constructor Detail

DataHolder

public DataHolder(Transaction t,
                  Dictionary<String,Object> data,
                  String type)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

checkInsert

public void checkInsert()
Checks if it is possible to insert data for all subrecords.
Does not check if same-table duplicate exists; duplicate errors are to be dealt with after an insertion attempt has been made by the implementation of insert()


checkUpdate

void checkUpdate(Pointer pointer)
Checks if it is possible to update for all subrecords.
Does not check if same-table duplicate exists; duplicate errors are to be dealt with after an update attempt has been made by the implementation of update(Pointer)

Parameters:
pointer - the pointer to the record to be updated

insert

public Pointer insert()

update

int update(Pointer p)