@Service @Transactional(readOnly=true) public class DatabaseServiceHibernateImpl extends java.lang.Object implements IDatabaseService, org.springframework.context.ApplicationContextAware
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
appContext |
Constructor and Description |
---|
DatabaseServiceHibernateImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
connectToDatabase(DatabaseTypeEnum databaseTypeEnum,
java.lang.String server,
java.lang.String database,
java.lang.String username,
java.lang.String password)
Connect to the database with the given parameters.
|
boolean |
connectToDatabase(DatabaseTypeEnum databaseTypeEnum,
java.lang.String server,
java.lang.String database,
java.lang.String username,
java.lang.String password,
int port,
java.lang.String filePath,
H2Mode mode)
Connect to the database with the given parameters
|
boolean |
connectToDatasource(CdmPersistentDataSource dataSource)
Connect to the database with the given parameters.
|
java.util.Map<CdmMetaDataPropertyName,java.lang.String> |
getCdmMetadataMap() |
java.lang.String |
getDbSchemaVersion()
Returns the CDM model schema version number
|
java.lang.String |
getUrl()
Returns the database URL
|
java.lang.String |
getUsername()
Returns the username.
|
boolean |
isDbEmpty()
Returns a boolean flag to indicate whether the database is empty
|
CdmPersistentDataSource |
saveDataSource(java.lang.String strDataSourceName,
ICdmDataSource dataSource)
Saves a new ICdmDatasource into the datasource config file.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setApplicationController(CdmApplicationController cdmApplicationController) |
CdmPersistentDataSource |
updateDataSource(java.lang.String strDataSourceName,
CdmPersistentDataSource dataSource)
Update an already saved datasource in datasource config file
|
@Autowired protected org.springframework.context.ApplicationContext appContext
public void setApplicationController(CdmApplicationController cdmApplicationController)
setApplicationController
in interface IDatabaseService
public boolean connectToDatasource(CdmPersistentDataSource dataSource) throws TermNotFoundException
IDatabaseService
connectToDatasource
in interface IDatabaseService
TermNotFoundException
public boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum, java.lang.String server, java.lang.String database, java.lang.String username, java.lang.String password, int port, java.lang.String filePath, H2Mode mode) throws TermNotFoundException
IDatabaseService
connectToDatabase
in interface IDatabaseService
TermNotFoundException
public boolean connectToDatabase(DatabaseTypeEnum databaseTypeEnum, java.lang.String server, java.lang.String database, java.lang.String username, java.lang.String password) throws TermNotFoundException
IDatabaseService
connectToDatabase
in interface IDatabaseService
TermNotFoundException
public CdmPersistentDataSource saveDataSource(java.lang.String strDataSourceName, ICdmDataSource dataSource)
IDatabaseService
saveDataSource
in interface IDatabaseService
public CdmPersistentDataSource updateDataSource(java.lang.String strDataSourceName, CdmPersistentDataSource dataSource) throws DataSourceNotFoundException
IDatabaseService
updateDataSource
in interface IDatabaseService
strDataSourceName
- the beanId under which the dataSource should be saveddataSource
- the dataSource to be savedDataSourceNotFoundException
public java.lang.String getUrl()
IDatabaseService
getUrl
in interface IDatabaseService
public java.lang.String getUsername()
IDatabaseService
getUsername
in interface IDatabaseService
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public java.lang.String getDbSchemaVersion() throws CdmSourceException
IDatabaseService
getDbSchemaVersion
in interface IDatabaseService
CdmSourceException
- , incase of an underlying SQL errorpublic boolean isDbEmpty() throws CdmSourceException
IDatabaseService
isDbEmpty
in interface IDatabaseService
CdmSourceException
- , incase of an underlying SQL errorpublic java.util.Map<CdmMetaDataPropertyName,java.lang.String> getCdmMetadataMap() throws CdmSourceException
getCdmMetadataMap
in interface IDatabaseService
CdmSourceException
Copyright © 2007-2020 EDIT. All Rights Reserved.