com.nec.tdd.tools.dbMapper
Interface DAOInterface
- All Known Implementing Classes:
- DefaultDAOImpl
- public interface DAOInterface
DAOInterface separates database access logic for a given class from
ORDBMapper.
The DAOInterface lists all the methods that need to be implemented in order
to create, delete, update and query object instances of a given type/class.
DAOInterface method signatures are identical to DBInterface methods
except each DAOInterface method has an extra connection argument of
type DBConnection.
All the ORDBMapper/DBInterface operations occur within the context of a
transaction. These transactions may be intiated by application code or by
ORDBMapper itself to ensure the atomicity of DBInterface operations.
The connection argument is the DBConnection object associated with the
current thread of execution participating in such database transaction.
The application programmer is expected use this database connection to
map user object(s) to from relation database, and forward all the exceptions
to dbMapper classes (so a transaction can be rolledback or commited
appropiately). However, an implementation may chose a different database
connection or screen the exceptions. In those cases, transaction behavior
is not guarenteed by DBMapper.
- See Also:
DBInterface
Method Summary |
void |
create(DBConnection connection,
java.lang.Object userObject)
|
void |
createTree(DBConnection connection,
java.lang.Object userObject,
int depth)
|
boolean |
delete(DBConnection connection,
java.lang.Object userObject)
|
int |
deleteAll(DBConnection connection,
java.lang.Class userObjectClass)
|
int |
deleteByAttributes(DBConnection connection,
java.util.HashMap attrValMap,
java.lang.Class userObjectClass)
|
boolean |
deleteByPrimaryKey(DBConnection connection,
java.lang.Object primaryKey,
java.lang.Class userObjectClass)
|
java.util.Collection |
findAll(DBConnection connection,
java.lang.Class userObjectClass)
|
java.util.Collection |
findAllPrimaryKeys(DBConnection connection,
java.lang.Class userObjectClass)
|
java.util.Collection |
findByAttributes(DBConnection connection,
java.util.HashMap attrValMap,
java.lang.Class userObjectClass)
|
java.lang.Object |
findByPrimaryKey(DBConnection connection,
java.lang.Object primaryKey,
java.lang.Class userObjectClass)
|
java.lang.Object |
findByPrimaryKey(DBConnection connection,
java.lang.Object primaryKey,
java.lang.Class userObjectClass,
int depth)
|
java.util.Collection |
findByQuery(DBConnection connection,
java.lang.String query,
java.lang.Class userObjectClass)
|
java.util.Collection |
findPrimaryKeysByAttributes(DBConnection connection,
java.util.HashMap attrValMap,
java.lang.Class userObjectClass)
|
java.util.Collection |
findPrimaryKeysByQuery(DBConnection connection,
java.lang.String query,
java.lang.Class userObjectClass)
|
boolean |
update(DBConnection connection,
java.lang.Object userObject)
|
boolean |
update(DBConnection connection,
java.lang.Object userObject,
java.util.HashMap attrValMap,
boolean bUpdateUserObject)
|
boolean |
updateTree(DBConnection connection,
java.lang.Object userObject,
int depth)
|
create
public void create(DBConnection connection,
java.lang.Object userObject)
throws java.lang.Exception
- See Also:
DBInterface.create(Object)
createTree
public void createTree(DBConnection connection,
java.lang.Object userObject,
int depth)
throws java.lang.Exception
- See Also:
DBInterface.createTree(Object)
,
DBInterface.createTree(Object,int)
delete
public boolean delete(DBConnection connection,
java.lang.Object userObject)
throws java.lang.Exception
- See Also:
DBInterface.delete(Object)
deleteByPrimaryKey
public boolean deleteByPrimaryKey(DBConnection connection,
java.lang.Object primaryKey,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.deleteByPrimaryKey(Object,Class)
deleteByAttributes
public int deleteByAttributes(DBConnection connection,
java.util.HashMap attrValMap,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.deleteByAttributes(AttrValMap,Class)
deleteAll
public int deleteAll(DBConnection connection,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.deleteAll(Class)
update
public boolean update(DBConnection connection,
java.lang.Object userObject)
throws java.lang.Exception
- See Also:
DBInterface.update(Object)
updateTree
public boolean updateTree(DBConnection connection,
java.lang.Object userObject,
int depth)
throws java.lang.Exception
- See Also:
DBInterface.updateTree(Object,int)
update
public boolean update(DBConnection connection,
java.lang.Object userObject,
java.util.HashMap attrValMap,
boolean bUpdateUserObject)
throws java.lang.Exception
- See Also:
DBInterface.update(Object,AttrValMap,boolean)
,
DBInterface.update(Object,HashMap,boolean)
findByPrimaryKey
public java.lang.Object findByPrimaryKey(DBConnection connection,
java.lang.Object primaryKey,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.findByPrimaryKey(Object,Class)
findByPrimaryKey
public java.lang.Object findByPrimaryKey(DBConnection connection,
java.lang.Object primaryKey,
java.lang.Class userObjectClass,
int depth)
throws java.lang.Exception
- See Also:
DBInterface.findByPrimaryKey(Object,Class,int)
findByAttributes
public java.util.Collection findByAttributes(DBConnection connection,
java.util.HashMap attrValMap,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.findByAttributes(AttrValMap,Class)
findByQuery
public java.util.Collection findByQuery(DBConnection connection,
java.lang.String query,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.findByQuery(String,Class)
findAll
public java.util.Collection findAll(DBConnection connection,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.findAll(Class)
findPrimaryKeysByAttributes
public java.util.Collection findPrimaryKeysByAttributes(DBConnection connection,
java.util.HashMap attrValMap,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.findPrimaryKeysByAttributes(AttrValMap,Class)
findPrimaryKeysByQuery
public java.util.Collection findPrimaryKeysByQuery(DBConnection connection,
java.lang.String query,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.findPrimaryKeysByQuery(String,Class)
findAllPrimaryKeys
public java.util.Collection findAllPrimaryKeys(DBConnection connection,
java.lang.Class userObjectClass)
throws java.lang.Exception
- See Also:
DBInterface.findAllPrimaryKeys(Class)