public class ImportDataDAO extends AbstractImportExportDAO
SQL_QUERY_GET_COLUMNS, SQL_QUERY_GET_COLUMNS_NAME
Constructor and Description |
---|
ImportDataDAO(List<String> listTableColumns,
String strTableName,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
Locale locale)
Creates a new DAO to import elements.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkElementExists(List<ImportExportElement> listElements)
Check if a row already exists in the database
|
void |
commitTransaction()
Commit the transaction to the database, and close the connection.
|
void |
emptyTable()
Remove every data from the table.
|
protected void |
finalize()
Finalize the DAO.
|
void |
insertElement(List<ImportExportElement> listElements)
Insert an element to the database.
|
void |
rollbackTransaction()
Roll back the transaction to the database, and close the connection.
|
void |
updateElement(List<ImportExportElement> listElements)
Update an element of the database.
|
getJavaTypeFromSqlString, getTableColumns, getTableColumnsNames
public ImportDataDAO(List<String> listTableColumns, String strTableName, fr.paris.lutece.portal.service.plugin.Plugin plugin, Locale locale) throws fr.paris.lutece.portal.service.util.AppException
commitTransaction()
or rollbackTransaction()
must be
called to close the connectionlistTableColumns
- The list of columns of the table to importstrTableName
- The name of the table to import data inplugin
- The plugin to get the pool fromlocale
- The locale to display errors infr.paris.lutece.portal.service.util.AppException
- If an error occurs during the initialization of this
DAOpublic void insertElement(List<ImportExportElement> listElements) throws fr.paris.lutece.portal.service.util.AppException, SQLException
listElements
- The list of elements to add in the statement. The
number of elements and the name of columns must be the same as
the columns associated with this DAO. fr.paris.lutece.portal.service.util.AppException
- If an error occurred during the insertionSQLException
- If an error occurred with the databasepublic void updateElement(List<ImportExportElement> listElements) throws fr.paris.lutece.portal.service.util.AppException, SQLException
listElements
- The list of elements to add in the statement. The
number of elements and the name of columns must be the same as
the columns associated with this DAO. fr.paris.lutece.portal.service.util.AppException
- If an error occurred during the updateSQLException
- If an error occurred with the databasepublic boolean checkElementExists(List<ImportExportElement> listElements) throws SQLException
listElements
- The list of elements to check the existence ofSQLException
- If an error occur while checking the existence of
the elementpublic void emptyTable() throws SQLException
SQLException
- If an error occurspublic void commitTransaction()
public void rollbackTransaction()
Copyright © 2018 City of Paris. All rights reserved.