Class InterestsDAO
- java.lang.Object
-
- org.silverpeas.core.pdc.interests.service.InterestsDAO
-
public class InterestsDAO extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
CREATE_IC_QUERY
createInterests sql query constantstatic String
CREATE_PDC_CONTEXT_QUERY
appendPdcContext sql query constantstatic String
DATE_FORMAT
Date format pattern constatnt.static String
GET_IC_BY_PK_QUERY
getInterestsByPK sql query constantstatic String
GET_IC_BY_USERID_QUERY
getInterestsByUserId sql query constantstatic String
INTERESTS_AXES_TABLE_NAME
Interest_Center_Axes table namestatic String
LOAD_PDC_PK_QUERY
loadPdcContext sql query constantstatic String
REMOVE_IC_BY_PKS_LIST_QUERY
removeInterestsById sql query constantstatic String
REMOVE_IC_CONTEXT_QUERY
removePdcContext sql query constantstatic String
UPDATE_IC_QUERY
updateInterests sql query constant
-
Constructor Summary
Constructors Constructor Description InterestsDAO()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
appendPdcContext(Connection con, List<? extends Criteria> pdcContext, int icId)
Appends a list of SearchCriteria to the Interests by idstatic Interests
getInterestsByPK(Connection con, int icID)
static List<Interests>
getInterestsByUserID(Connection con, int userid)
static List<Criteria>
loadPdcContext(Connection con, int icId)
static void
removeInterestsByPK(Connection con, int removeID)
static void
removeInterestsByPK(Connection con, List<Integer> removePKList)
static void
removePdcContext(Connection con, int icId)
Remove all SearchCriterias for provided interests idstatic int
saveInterests(Connection con, Interests interests)
static void
updateInterests(Connection con, Interests interests)
perform updates of provided Interestsstatic void
updatePdcContext(Connection con, List<? extends Criteria> list, int icId)
Updates SearchCriterias list for interests by id
-
-
-
Field Detail
-
INTERESTS_AXES_TABLE_NAME
public static final String INTERESTS_AXES_TABLE_NAME
Interest_Center_Axes table name- See Also:
- Constant Field Values
-
DATE_FORMAT
public static final String DATE_FORMAT
Date format pattern constatnt. This patters is used in db operations- See Also:
- Constant Field Values
-
GET_IC_BY_USERID_QUERY
public static final String GET_IC_BY_USERID_QUERY
getInterestsByUserId sql query constant- See Also:
- Constant Field Values
-
GET_IC_BY_PK_QUERY
public static final String GET_IC_BY_PK_QUERY
getInterestsByPK sql query constant- See Also:
- Constant Field Values
-
CREATE_IC_QUERY
public static final String CREATE_IC_QUERY
createInterests sql query constant- See Also:
- Constant Field Values
-
UPDATE_IC_QUERY
public static final String UPDATE_IC_QUERY
updateInterests sql query constant- See Also:
- Constant Field Values
-
REMOVE_IC_BY_PKS_LIST_QUERY
public static final String REMOVE_IC_BY_PKS_LIST_QUERY
removeInterestsById sql query constant- See Also:
- Constant Field Values
-
LOAD_PDC_PK_QUERY
public static final String LOAD_PDC_PK_QUERY
loadPdcContext sql query constant- See Also:
- Constant Field Values
-
CREATE_PDC_CONTEXT_QUERY
public static final String CREATE_PDC_CONTEXT_QUERY
appendPdcContext sql query constant- See Also:
- Constant Field Values
-
REMOVE_IC_CONTEXT_QUERY
public static final String REMOVE_IC_CONTEXT_QUERY
removePdcContext sql query constant- See Also:
- Constant Field Values
-
-
Method Detail
-
getInterestsByUserID
public static List<Interests> getInterestsByUserID(Connection con, int userid) throws SQLException, InterestsDAOException
- Parameters:
con
-userid
-- Returns:
- a list of
Interests
s by user id provided - Throws:
SQLException
InterestsDAOException
-
getInterestsByPK
public static Interests getInterestsByPK(Connection con, int icID) throws SQLException, InterestsDAOException
- Parameters:
icID
-Interests
id- Returns:
- Interests by its id
- Throws:
SQLException
InterestsDAOException
-
saveInterests
public static int saveInterests(Connection con, Interests interests) throws SQLException, InterestsDAOException
- Returns:
- id of
Interests
created - Throws:
SQLException
InterestsDAOException
-
updateInterests
public static void updateInterests(Connection con, Interests interests) throws SQLException, InterestsDAOException
perform updates of provided Interests- Throws:
SQLException
InterestsDAOException
-
removeInterestsByPK
public static void removeInterestsByPK(Connection con, List<Integer> removePKList) throws SQLException, InterestsDAOException
- Parameters:
removePKList
- id's ofInterests
s to be deleted- Throws:
SQLException
InterestsDAOException
-
removeInterestsByPK
public static void removeInterestsByPK(Connection con, int removeID) throws SQLException, InterestsDAOException
- Parameters:
removeID
- an id ofInterests
to be deleted- Throws:
SQLException
InterestsDAOException
-
loadPdcContext
public static List<Criteria> loadPdcContext(Connection con, int icId) throws SQLException, InterestsDAOException
- Returns:
- list of SearchCriteria
- Throws:
SQLException
InterestsDAOException
-
appendPdcContext
public static int[] appendPdcContext(Connection con, List<? extends Criteria> pdcContext, int icId) throws SQLException, InterestsDAOException
Appends a list of SearchCriteria to the Interests by id- Parameters:
icId
- the interests id- Throws:
SQLException
InterestsDAOException
-
updatePdcContext
public static void updatePdcContext(Connection con, List<? extends Criteria> list, int icId) throws SQLException, InterestsDAOException
Updates SearchCriterias list for interests by id- Parameters:
icId
- interests id- Throws:
SQLException
InterestsDAOException
-
removePdcContext
public static void removePdcContext(Connection con, int icId) throws SQLException, InterestsDAOException
Remove all SearchCriterias for provided interests id- Parameters:
icId
- the interests id- Throws:
SQLException
InterestsDAOException
-
-