@Component public class DatabaseHelper extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements IDatabaseHelper
IDatabaseHelper| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
static String |
NORMALIZE_TEXT_FUNCTION_NAME |
static String |
NORMALIZE_TEXT_POSTRES_FUNCTION_BODY |
static String[] |
TABLES_NAME_THAT_MUST_BE_KEPT_WHEN_RESETING_IMPORT |
| Constructor and Description |
|---|
DatabaseHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
createNormalize_textFunction()
create a postgres function in postgres to remove accent, lower cased, trim, and
remove unwanted char (, . ; ")
|
void |
dropNormalize_textFunction()
Drop the Normalize_text function in postgres
|
List<String> |
execute(File file,
boolean continueOnError) |
void |
generateSqlCreationSchemaFile(File outputFile)
Generate the sql file to create all the Gisgraphy tables
|
void |
generateSQLCreationSchemaFileToRerunImport(File outputFile)
Generate the SQL file to create all the Gisgraphy tables that have to be
reset to rerun the import, the user and role tables won't be deleted
|
void |
generateSQLDropSchemaFile(File outputFile)
Generate the sql file to drop all the Gisgraphy tables
|
void |
generateSqlDropSchemaFileToRerunImport(File outputFile)
Generate the SQL file to drop all the Gisgraphy tables that have to be
reset to rerun the import, the user and role tables won't be deleted
|
boolean |
isNormalize_textFunctionCreated()
Determines if the normalize_text function is created in postgres
|
protected static final org.slf4j.Logger logger
public static String[] TABLES_NAME_THAT_MUST_BE_KEPT_WHEN_RESETING_IMPORT
public static final String NORMALIZE_TEXT_FUNCTION_NAME
public static final String NORMALIZE_TEXT_POSTRES_FUNCTION_BODY
public List<String> execute(File file, boolean continueOnError) throws Exception
execute in interface IDatabaseHelperfile - the file to execute, it will be read as an UTF-8 filecontinueOnError - if an error occured, the process will go on if this value is
true, if not it will throw an exceptionException - in case of error during execution, or if the file is null or
does not existpublic void generateSqlCreationSchemaFile(File outputFile)
IDatabaseHelpergenerateSqlCreationSchemaFile in interface IDatabaseHelperoutputFile - The File that we want to write the SQLpublic void generateSQLDropSchemaFile(File outputFile)
IDatabaseHelpergenerateSQLDropSchemaFile in interface IDatabaseHelperoutputFile - The File that we want to write the SQLpublic void generateSQLCreationSchemaFileToRerunImport(File outputFile)
IDatabaseHelpergenerateSQLCreationSchemaFileToRerunImport in interface IDatabaseHelperoutputFile - The File that we want to write the SQLpublic void generateSqlDropSchemaFileToRerunImport(File outputFile)
IDatabaseHelpergenerateSqlDropSchemaFileToRerunImport in interface IDatabaseHelperoutputFile - The File that we want to write the SQLpublic void createNormalize_textFunction()
IDatabaseHelpercreateNormalize_textFunction in interface IDatabaseHelperpublic boolean isNormalize_textFunctionCreated()
IDatabaseHelperisNormalize_textFunctionCreated in interface IDatabaseHelperpublic void dropNormalize_textFunction()
IDatabaseHelperdropNormalize_textFunction in interface IDatabaseHelperCopyright © 2015. All rights reserved.