Class InstanceDataTable
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractTable<T>
-
- org.silverpeas.core.admin.persistence.Table<InstanceDataRow>
-
- org.silverpeas.core.admin.persistence.InstanceDataTable
-
@Repository public class InstanceDataTable extends Table<InstanceDataRow>
A InstanceData object manages component parameters
-
-
Constructor Summary
Constructors Constructor Description InstanceDataTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createInstanceData(int componentId, LocalizedParameter parameter)
Inserts in the database a new instanceData row.protected InstanceDataRow
fetchInstanceData(ResultSet rs)
Fetch the current instanceData row from a resultSet.protected InstanceDataRow
fetchRow(ResultSet rs)
Fetch the current instanceData row from a resultSet.List<Parameter>
getAllParametersInComponent(int componentId)
Returns all the parameters of the given component (List of SPParameter)List<Integer>
getComponentIdsWithParameterValue(Parameter param)
Returns all component ids according to given param and param valueString
getParameterValueByComponentAndParamName(Integer componentId, String paramName, boolean ignoreCase)
Get the value of given parameter and about given component.Map<Integer,Map<String,String>>
getParameterValuesByComponentAndByParamName(Collection<Integer> componentIds, Collection<String> paramNames)
Gets all parameters values by component and by parameter name.protected void
prepareInsert(String insertQuery, PreparedStatement insert, InstanceDataRow row)
protected void
prepareUpdate(String updateQuery, PreparedStatement update, InstanceDataRow row)
void
removeInstanceData(int id)
Removes a instance data row.void
updateInstanceData(int componentId, LocalizedParameter parameter)
Updates a instance data row.-
Methods inherited from class org.silverpeas.core.admin.persistence.Table
addIdToQuery, addParamToQuery, addParamToQuery, aliasColumns, checkGroupExistence, checkUserExistence, getCount, getCount, getIds, getIds, getIds, getIds, getNotNullString, getRows, performPrepareStatementParams, updateRelation
-
Methods inherited from class org.silverpeas.core.persistence.jdbc.AbstractTable
getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, truncate, updateRelation, updateRelation, updateRow
-
-
-
-
Method Detail
-
createInstanceData
public void createInstanceData(int componentId, LocalizedParameter parameter) throws SQLException
Inserts in the database a new instanceData row.- Throws:
SQLException
-
prepareInsert
protected void prepareInsert(String insertQuery, PreparedStatement insert, InstanceDataRow row) throws SQLException
- Specified by:
prepareInsert
in classAbstractTable<InstanceDataRow>
- Throws:
SQLException
-
getAllParametersInComponent
public List<Parameter> getAllParametersInComponent(int componentId) throws SQLException
Returns all the parameters of the given component (List of SPParameter)- Throws:
SQLException
-
getParameterValueByComponentAndParamName
public String getParameterValueByComponentAndParamName(Integer componentId, String paramName, boolean ignoreCase) throws SQLException
Get the value of given parameter and about given component.- Parameters:
componentId
- component identifier.paramName
- parameter name.ignoreCase
- true to ignore case on parameter name.- Returns:
- return the value as string, or
StringUtil.EMPTY
if parameter has not been found. - Throws:
SQLException
- on database error.
-
getParameterValuesByComponentAndByParamName
public Map<Integer,Map<String,String>> getParameterValuesByComponentAndByParamName(Collection<Integer> componentIds, Collection<String> paramNames) throws SQLException
Gets all parameters values by component and by parameter name.- Parameters:
componentIds
- list of component identifier.paramNames
- optional list of parameter name. All parameters are retrieved if it is not filled or null- Throws:
SQLException
- on database error.
-
getComponentIdsWithParameterValue
public List<Integer> getComponentIdsWithParameterValue(Parameter param) throws SQLException
Returns all component ids according to given param and param value- Throws:
SQLException
-
updateInstanceData
public void updateInstanceData(int componentId, LocalizedParameter parameter) throws SQLException
Updates a instance data row.- Throws:
SQLException
-
removeInstanceData
public void removeInstanceData(int id) throws SQLException
Removes a instance data row.- Throws:
SQLException
-
fetchRow
protected InstanceDataRow fetchRow(ResultSet rs) throws SQLException
Fetch the current instanceData row from a resultSet.- Specified by:
fetchRow
in classAbstractTable<InstanceDataRow>
- Parameters:
rs
- the result set from which the row will be fetched.- Returns:
- the entity in the row.
- Throws:
SQLException
- on SQL error.
-
fetchInstanceData
protected InstanceDataRow fetchInstanceData(ResultSet rs) throws SQLException
Fetch the current instanceData row from a resultSet.- Throws:
SQLException
-
prepareUpdate
protected void prepareUpdate(String updateQuery, PreparedStatement update, InstanceDataRow row) throws SQLException
- Specified by:
prepareUpdate
in classAbstractTable<InstanceDataRow>
- Throws:
SQLException
-
-