|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- public interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
SilverpeasBeanDAO is the interface to use for instanciable component persistence. To get a
SilverpeasBeanDAO instance, use the SilverpeasBeanDAO factory. A SilverpeasBeanDAO instance is
linked with a SilverpeasBean specialisation. The code below show you how to build a
SilverpeasBeanDAO, enable to create, update... objects for TrainingDetail class.
// get a dao instance, associated with TrainingDetail bean class
SilverpeasBeanDAO dao = SilverpeasBeanDAOFactory.getDAO("com.stratelia.webactiv.training.model.TrainingDetail");
Once a dao instance is build, it enables you to create, update, remove and list objects
from TrainingDetail. TrainingDetail has to be a SilverpeasBean specialisation. (A SilverpeasBean
contains a PK). The persistance mechanism is based on your bean properties. In your bean, you
need to have getXXX and setXXX methods for each "column" you want to be persistant. For the
moment, SilverpeasBeanDAO is able to work with int, String and Date. This list can grow in the
near futur.
Field Summary | |
---|---|
static int |
CONNECTION_TYPE_DATASOURCE
|
static int |
CONNECTION_TYPE_DATASOURCE_SILVERPEAS
|
static int |
CONNECTION_TYPE_EJBDATASOURCE_SILVERPEAS
|
static int |
CONNECTION_TYPE_JDBC_CLASSIC
|
Method Summary | |
---|---|
WAPrimaryKey |
add(Connection con,
T bean)
|
WAPrimaryKey |
add(T bean)
create the bean and a row in DB. |
T |
findByPrimaryKey(Connection con,
WAPrimaryKey pk)
|
T |
findByPrimaryKey(WAPrimaryKey pk)
get a bean representing a row in db from its pk |
Collection<T> |
findByWhereClause(Connection con,
WAPrimaryKey pk,
String whereClause)
|
Collection<T> |
findByWhereClause(WAPrimaryKey pk,
String whereClause)
get a bean list, representing a specific row selection. |
void |
remove(Connection con,
WAPrimaryKey pk)
|
void |
remove(WAPrimaryKey pk)
remove the row in db represented by the primary key. |
void |
removeWhere(Connection con,
WAPrimaryKey pk,
String p_WhereClause)
|
void |
removeWhere(WAPrimaryKey pk,
String p_WhereClause)
remove all row in db represented by the where clause. |
void |
update(Connection con,
T bean)
|
void |
update(T bean)
update the row in db with the new bean properties. |
Field Detail |
---|
static final int CONNECTION_TYPE_EJBDATASOURCE_SILVERPEAS
static final int CONNECTION_TYPE_DATASOURCE_SILVERPEAS
static final int CONNECTION_TYPE_DATASOURCE
static final int CONNECTION_TYPE_JDBC_CLASSIC
Method Detail |
---|
void update(T bean) throws PersistenceException
bean
- the SilverpeasBean to update, with its complete primaryKey.
PersistenceException
void update(Connection con, T bean) throws PersistenceException
PersistenceException
WAPrimaryKey add(T bean) throws PersistenceException
bean
- the SilverpeasBeanIntf to update, with a primaryKey initialized with only spaceId
and componentId.
PersistenceException
WAPrimaryKey add(Connection con, T bean) throws PersistenceException
PersistenceException
void remove(WAPrimaryKey pk) throws PersistenceException
bean
- the SilverpeasBeanIntf to update, with a primaryKey initialized with only spaceId
and componentId.
PersistenceException
void remove(Connection con, WAPrimaryKey pk) throws PersistenceException
PersistenceException
void removeWhere(WAPrimaryKey pk, String p_WhereClause) throws PersistenceException
the
- where clause.
PersistenceException
void removeWhere(Connection con, WAPrimaryKey pk, String p_WhereClause) throws PersistenceException
PersistenceException
Collection<T> findByWhereClause(WAPrimaryKey pk, String whereClause) throws PersistenceException
pk
- the beans primary key initialized with at least spaceId and componentId.whereClause
- The where clause to put in select request. If null, all SilverpeasBeanIntfs
will be selected (all rows in the table).
PersistenceException
Collection<T> findByWhereClause(Connection con, WAPrimaryKey pk, String whereClause) throws PersistenceException
PersistenceException
T findByPrimaryKey(WAPrimaryKey pk) throws PersistenceException
pk
- the complete beans primary key
PersistenceException
T findByPrimaryKey(Connection con, WAPrimaryKey pk) throws PersistenceException
PersistenceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |