org.opensubsystems.core.persist
Interface BasicDataFactory

All Superinterfaces:
DataFactory
All Known Subinterfaces:
ModifiableDataFactory

public interface BasicDataFactory
extends DataFactory

Basic operations to perform with the data object in the persistence store. It just defines retrieve, create and delete operations since these are the basic we need to perform any kind of data populations as well as tests with data.

Version:
$Id: BasicDataFactory.java,v 1.5 2007/01/28 06:54:51 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Method Summary
 int create(java.util.Collection colDataObject)
          Create collection of data objects.
 DataObject create(DataObject data)
          Create data object in the persistance store.
 void delete(int iId, int iDomainId)
          Delete specified data.
 
Methods inherited from interface org.opensubsystems.core.persist.DataFactory
get, getDataType
 

Method Detail

create

DataObject create(DataObject data)
                  throws OSSException
Create data object in the persistance store.

Parameters:
data - - data to create
Returns:
DataObject - newly created data
Throws:
OSSException - - an error while creating data

create

int create(java.util.Collection colDataObject)
           throws OSSException
Create collection of data objects.

Parameters:
colDataObject - - collection of data objects that will be created
Returns:
int - number of inserted data items
Throws:
OSSException - - error during create

delete

void delete(int iId,
            int iDomainId)
            throws OSSException
Delete specified data.

Parameters:
iId - - id of the data object to be deleted
iDomainId - - if the data object exists in a domain then by specifying the domain id it allows the persistance store to limit the data that will be searched and also possibly enforce in what domain the id can possibly exist. This allows to enforce security on the persistance layer that by ensuring that if the data object doesn't exist in the domain where it is expected to exist, it will not be even deleted. If the data object doesnt exist in the domain, you can pass DataObject.NEW_ID here since it won't be used.
Throws:
OSSException - - an error has occured deleting data


Copyright © 2003 - 2006 OpenSubsystems s.r.o.