Class ComponentInstanceI18NTable
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractTable<T>
-
- org.silverpeas.core.admin.persistence.Table<ComponentInstanceI18NRow>
-
- org.silverpeas.core.admin.persistence.ComponentInstanceI18NTable
-
@Repository public class ComponentInstanceI18NTable extends Table<ComponentInstanceI18NRow>
A ComponentInstanceI18NTable object manages the ST_ComponentInstance table.
-
-
Constructor Summary
Constructors Constructor Description ComponentInstanceI18NTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createTranslation(ComponentInstanceI18NRow translation)
Inserts in the database a new component row.protected ComponentInstanceI18NRow
fetchRow(ResultSet rs)
Fetch the current component row from a resultSet.Map<Integer,List<ComponentInstanceI18NRow>>
getIndexedTranslations(Connection con, Collection<Integer> componentIds)
Gets the translations of component instance represented by the given identifiers indexed by identifiers of component instance.List<ComponentInstanceI18NRow>
getTranslations(int componentId)
Returns the Component with the given id.protected void
prepareInsert(String insertQuery, PreparedStatement insert, ComponentInstanceI18NRow row)
protected void
prepareUpdate(String updateQuery, PreparedStatement update, ComponentInstanceI18NRow row)
void
removeTranslation(int id)
Delete a translation.void
removeTranslations(int componentId)
Delete all component's translations.void
updateTranslation(ComponentInstanceI18NRow component)
Updates a component 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
-
getTranslations
public List<ComponentInstanceI18NRow> getTranslations(int componentId) throws SQLException
Returns the Component with the given id.- Parameters:
componentId
- the identifier of the component instance to check.- Returns:
- the Component with the given id.
- Throws:
SQLException
- on technical problem.
-
getIndexedTranslations
public Map<Integer,List<ComponentInstanceI18NRow>> getIndexedTranslations(Connection con, Collection<Integer> componentIds) throws SQLException
Gets the translations of component instance represented by the given identifiers indexed by identifiers of component instance.- Parameters:
con
- a database connection.componentIds
- the identifiers of component instance.- Returns:
- a
Map
which translations are indexed by identifiers of component instance. - Throws:
SQLException
- on technical problem.
-
createTranslation
public void createTranslation(ComponentInstanceI18NRow translation) throws SQLException
Inserts in the database a new component row.- Parameters:
translation
-- Throws:
SQLException
-
prepareInsert
protected void prepareInsert(String insertQuery, PreparedStatement insert, ComponentInstanceI18NRow row) throws SQLException
- Specified by:
prepareInsert
in classAbstractTable<ComponentInstanceI18NRow>
- Throws:
SQLException
-
updateTranslation
public void updateTranslation(ComponentInstanceI18NRow component) throws SQLException
Updates a component row.- Parameters:
component
-- Throws:
SQLException
-
prepareUpdate
protected void prepareUpdate(String updateQuery, PreparedStatement update, ComponentInstanceI18NRow row) throws SQLException
- Specified by:
prepareUpdate
in classAbstractTable<ComponentInstanceI18NRow>
- Throws:
SQLException
-
removeTranslation
public void removeTranslation(int id) throws SQLException
Delete a translation.- Parameters:
id
-- Throws:
SQLException
-
removeTranslations
public void removeTranslations(int componentId) throws SQLException
Delete all component's translations.- Parameters:
componentId
-- Throws:
SQLException
-
fetchRow
protected ComponentInstanceI18NRow fetchRow(ResultSet rs) throws SQLException
Fetch the current component row from a resultSet.- Specified by:
fetchRow
in classAbstractTable<ComponentInstanceI18NRow>
- Parameters:
rs
- the result set from which the row will be fetched.- Returns:
- the entity in the row.
- Throws:
SQLException
- on SQL error.
-
-