com.stratelia.webactiv.persistence
Class SilverpeasBeanDAOImpl<T extends SilverpeasBeanIntf>

java.lang.Object
  extended by com.stratelia.webactiv.persistence.SilverpeasBeanDAOImpl<T>
All Implemented Interfaces:
SilverpeasBeanDAO<T>

public class SilverpeasBeanDAOImpl<T extends SilverpeasBeanIntf>
extends Object
implements SilverpeasBeanDAO<T>


Field Summary
 
Fields inherited from interface com.stratelia.webactiv.persistence.SilverpeasBeanDAO
CONNECTION_TYPE_DATASOURCE, CONNECTION_TYPE_DATASOURCE_SILVERPEAS, CONNECTION_TYPE_EJBDATASOURCE_SILVERPEAS, CONNECTION_TYPE_JDBC_CLASSIC
 
Constructor Summary
SilverpeasBeanDAOImpl(String beanClassName)
           
 
Method Summary
 WAPrimaryKey add(Connection connection, T bean)
           
 WAPrimaryKey add(T bean)
          create the bean and a row in DB.
 T findByPrimaryKey(Connection connection, WAPrimaryKey pk)
           
 T findByPrimaryKey(WAPrimaryKey pk)
          get a bean representing a row in db from its pk
 Collection<T> findByWhereClause(Connection connection, WAPrimaryKey pk, String whereClause)
           
 Collection<T> findByWhereClause(WAPrimaryKey pk, String whereClause)
          get a bean list, representing a specific row selection.
 void remove(Connection connection, WAPrimaryKey pk)
           
 void remove(WAPrimaryKey pk)
          remove the row in db represented by the primary key.
 void removeWhere(Connection connection, WAPrimaryKey pk, String whereClause)
           
 void removeWhere(WAPrimaryKey pk, String whereClause)
          remove all row in db represented by the where clause.
 void update(Connection connection, T bean)
           
 void update(T bean)
          update the row in db with the new bean properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SilverpeasBeanDAOImpl

public SilverpeasBeanDAOImpl(String beanClassName)
                      throws PersistenceException
Throws:
PersistenceException
Method Detail

remove

public void remove(WAPrimaryKey pk)
            throws PersistenceException
Description copied from interface: SilverpeasBeanDAO
remove the row in db represented by the primary key.

Specified by:
remove in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException

remove

public void remove(Connection connection,
                   WAPrimaryKey pk)
            throws PersistenceException
Specified by:
remove in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException

removeWhere

public void removeWhere(WAPrimaryKey pk,
                        String whereClause)
                 throws PersistenceException
Description copied from interface: SilverpeasBeanDAO
remove all row in db represented by the where clause.

Specified by:
removeWhere in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException

removeWhere

public void removeWhere(Connection connection,
                        WAPrimaryKey pk,
                        String whereClause)
                 throws PersistenceException
Specified by:
removeWhere in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException

update

public void update(T bean)
            throws PersistenceException
Description copied from interface: SilverpeasBeanDAO
update the row in db with the new bean properties.

Specified by:
update in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Parameters:
bean - the SilverpeasBean to update, with its complete primaryKey.
Throws:
PersistenceException

update

public void update(Connection connection,
                   T bean)
            throws PersistenceException
Specified by:
update in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException

add

public WAPrimaryKey add(T bean)
                 throws PersistenceException
Description copied from interface: SilverpeasBeanDAO
create the bean and a row in DB.

Specified by:
add in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
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

add

public WAPrimaryKey add(Connection connection,
                        T bean)
                 throws PersistenceException
Specified by:
add in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException

findByPrimaryKey

public T findByPrimaryKey(WAPrimaryKey pk)
                                              throws PersistenceException
Description copied from interface: SilverpeasBeanDAO
get a bean representing a row in db from its pk

Specified by:
findByPrimaryKey in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Parameters:
pk - the complete beans primary key
Returns:
The SilverpeasBeanIntfs corresponding to the pk, null if not found
Throws:
PersistenceException

findByPrimaryKey

public T findByPrimaryKey(Connection connection,
                          WAPrimaryKey pk)
                                              throws PersistenceException
Specified by:
findByPrimaryKey in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException

findByWhereClause

public Collection<T> findByWhereClause(WAPrimaryKey pk,
                                       String whereClause)
                                                           throws PersistenceException
Description copied from interface: SilverpeasBeanDAO
get a bean list, representing a specific row selection.

Specified by:
findByWhereClause in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
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

findByWhereClause

public Collection<T> findByWhereClause(Connection connection,
                                       WAPrimaryKey pk,
                                       String whereClause)
                                                           throws PersistenceException
Specified by:
findByWhereClause in interface SilverpeasBeanDAO<T extends SilverpeasBeanIntf>
Throws:
PersistenceException


Copyright © 2016 Silverpeas. All Rights Reserved.