|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
com.gisgraphy.domain.repository.DatabaseHelper
@Component public class DatabaseHelper
Default implementation of IDatabaseHelper
Field Summary | |
---|---|
protected static org.slf4j.Logger |
logger
|
static java.lang.String |
NORMALIZE_TEXT_FUNCTION_NAME
|
static java.lang.String |
NORMALIZE_TEXT_POSTRES_FUNCTION_BODY
|
static java.lang.String[] |
TABLES_NAME_THAT_MUST_BE_KEPT_WHEN_RESETING_IMPORT
|
Constructor Summary | |
---|---|
DatabaseHelper()
|
Method Summary | |
---|---|
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 |
java.util.List<java.lang.String> |
execute(java.io.File file,
boolean continueOnError)
|
void |
generateSqlCreationSchemaFile(java.io.File outputFile)
Generate the sql file to create all the Gisgraphy tables |
void |
generateSQLCreationSchemaFileToRerunImport(java.io.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(java.io.File outputFile)
Generate the sql file to drop all the Gisgraphy tables |
void |
generateSqlDropSchemaFileToRerunImport(java.io.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 |
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
Methods inherited from class org.springframework.dao.support.DaoSupport |
---|
afterPropertiesSet, initDao |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger logger
public static java.lang.String[] TABLES_NAME_THAT_MUST_BE_KEPT_WHEN_RESETING_IMPORT
public static final java.lang.String NORMALIZE_TEXT_FUNCTION_NAME
public static final java.lang.String NORMALIZE_TEXT_POSTRES_FUNCTION_BODY
Constructor Detail |
---|
public DatabaseHelper()
Method Detail |
---|
public java.util.List<java.lang.String> execute(java.io.File file, boolean continueOnError) throws java.lang.Exception
execute
in interface IDatabaseHelper
file
- 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 exception
java.lang.Exception
- in case of error during execution, or if the file is null or
does not existpublic void generateSqlCreationSchemaFile(java.io.File outputFile)
IDatabaseHelper
generateSqlCreationSchemaFile
in interface IDatabaseHelper
outputFile
- The File that we want to write the SQLpublic void generateSQLDropSchemaFile(java.io.File outputFile)
IDatabaseHelper
generateSQLDropSchemaFile
in interface IDatabaseHelper
outputFile
- The File that we want to write the SQLpublic void generateSQLCreationSchemaFileToRerunImport(java.io.File outputFile)
IDatabaseHelper
generateSQLCreationSchemaFileToRerunImport
in interface IDatabaseHelper
outputFile
- The File that we want to write the SQLpublic void generateSqlDropSchemaFileToRerunImport(java.io.File outputFile)
IDatabaseHelper
generateSqlDropSchemaFileToRerunImport
in interface IDatabaseHelper
outputFile
- The File that we want to write the SQLpublic void createNormalize_textFunction()
IDatabaseHelper
createNormalize_textFunction
in interface IDatabaseHelper
public boolean isNormalize_textFunctionCreated()
IDatabaseHelper
isNormalize_textFunctionCreated
in interface IDatabaseHelper
public void dropNormalize_textFunction()
IDatabaseHelper
dropNormalize_textFunction
in interface IDatabaseHelper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |