Interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
-
- Type Parameters:
T
- the SilverpeasBeanIntf type
- All Known Implementing Classes:
SilverpeasBeanDAOImpl
@Deprecated public interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Deprecated.Replaced it with the new persistence layer built upon JPASilverpeasBeanDAO 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
Fields Modifier and Type Field Description static int
CONNECTION_TYPE_DATASOURCE
Deprecated.static int
CONNECTION_TYPE_DATASOURCE_SILVERPEAS
Deprecated.static int
CONNECTION_TYPE_EJBDATASOURCE_SILVERPEAS
Deprecated.static int
CONNECTION_TYPE_JDBC_CLASSIC
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description WAPrimaryKey
add(Connection con, T bean)
Deprecated.WAPrimaryKey
add(T bean)
Deprecated.create the bean and a row in DB.T
findByPrimaryKey(Connection con, WAPrimaryKey pk)
Deprecated.T
findByPrimaryKey(WAPrimaryKey pk)
Deprecated.get a bean representing a row in db from its pkCollection<T>
findByWhereClause(Connection con, WAPrimaryKey pk, String whereClause)
Deprecated.Collection<T>
findByWhereClause(WAPrimaryKey pk, String whereClause)
Deprecated.get a bean list, representing a specific row selection.void
remove(Connection con, WAPrimaryKey pk)
Deprecated.void
remove(WAPrimaryKey pk)
Deprecated.remove the row in db represented by the primary key.void
removeWhere(Connection con, WAPrimaryKey pk, String p_WhereClause)
Deprecated.void
removeWhere(WAPrimaryKey pk, String p_WhereClause)
Deprecated.remove all row in db represented by the where clause.void
update(Connection con, T bean)
Deprecated.void
update(T bean)
Deprecated.update the row in db with the new bean properties.
-
-
-
Field Detail
-
CONNECTION_TYPE_EJBDATASOURCE_SILVERPEAS
static final int CONNECTION_TYPE_EJBDATASOURCE_SILVERPEAS
Deprecated.- See Also:
- Constant Field Values
-
CONNECTION_TYPE_DATASOURCE_SILVERPEAS
static final int CONNECTION_TYPE_DATASOURCE_SILVERPEAS
Deprecated.- See Also:
- Constant Field Values
-
CONNECTION_TYPE_DATASOURCE
static final int CONNECTION_TYPE_DATASOURCE
Deprecated.- See Also:
- Constant Field Values
-
CONNECTION_TYPE_JDBC_CLASSIC
static final int CONNECTION_TYPE_JDBC_CLASSIC
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
update
void update(T bean) throws PersistenceException
Deprecated.update the row in db with the new bean properties.- Parameters:
bean
- the SilverpeasBean to update, with its complete primaryKey.- Throws:
PersistenceException
- if the update fails.
-
update
void update(Connection con, T bean) throws PersistenceException
Deprecated.- Throws:
PersistenceException
-
add
WAPrimaryKey add(T bean) throws PersistenceException
Deprecated.create the bean and a row in DB.- Parameters:
bean
- the SilverpeasBeanIntf to update, with a primaryKey initialized with only spaceId and componentId.- Returns:
- The complete primary key, with the id.
- Throws:
PersistenceException
- if the creation fails.
-
add
WAPrimaryKey add(Connection con, T bean) throws PersistenceException
Deprecated.- Throws:
PersistenceException
-
remove
void remove(WAPrimaryKey pk) throws PersistenceException
Deprecated.remove the row in db represented by the primary key.- Parameters:
pk
- the SilverpeasBeanIntf to update, with a primaryKey initialized with only spaceId and componentId.- Throws:
PersistenceException
- if the deletion fails.
-
remove
void remove(Connection con, WAPrimaryKey pk) throws PersistenceException
Deprecated.- Throws:
PersistenceException
-
removeWhere
void removeWhere(WAPrimaryKey pk, String p_WhereClause) throws PersistenceException
Deprecated.remove all row in db represented by the where clause.- Parameters:
pk
- the specific identifierp_WhereClause
- the where clause.- Throws:
PersistenceException
- if the deletion fails.
-
removeWhere
void removeWhere(Connection con, WAPrimaryKey pk, String p_WhereClause) throws PersistenceException
Deprecated.- Throws:
PersistenceException
-
findByWhereClause
Collection<T> findByWhereClause(WAPrimaryKey pk, String whereClause) throws PersistenceException
Deprecated.get a bean list, representing a specific row selection.- Parameters:
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).- Returns:
- The list of SilverpeasBeanIntfs corresponding to the where clause
- Throws:
PersistenceException
- if the finding fails.
-
findByWhereClause
Collection<T> findByWhereClause(Connection con, WAPrimaryKey pk, String whereClause) throws PersistenceException
Deprecated.- Throws:
PersistenceException
-
findByPrimaryKey
T findByPrimaryKey(WAPrimaryKey pk) throws PersistenceException
Deprecated.get a bean representing a row in db from its pk- Parameters:
pk
- the complete beans primary key- Returns:
- The SilverpeasBeanIntfs corresponding to the pk, null if not found
- Throws:
PersistenceException
- if the finding fails.
-
findByPrimaryKey
T findByPrimaryKey(Connection con, WAPrimaryKey pk) throws PersistenceException
Deprecated.- Throws:
PersistenceException
-
-