public class DatabaseUtils extends Object
Modifier and Type | Class and Description |
---|---|
class |
DatabaseUtils.TableDates |
Modifier and Type | Field and Description |
---|---|
static int |
BLOCKING_QUEUE_TIMEOUT |
static String |
DNET_RESOURCE_ID_FIELD |
Constructor and Description |
---|
DatabaseUtils() |
public static final String DNET_RESOURCE_ID_FIELD
public static final int BLOCKING_QUEUE_TIMEOUT
public List<String> listCommonDBTables(String database) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public List<String> listCommonDBViews(String database) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public Map<String,DatabaseUtils.TableDates> getTableDatesForDB(String db) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public List<DnetDatabase> listAllDatabases() throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public <T> List<T> getTypedListFromSql(String dbName, String query, Class<T> clazz) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public List<String> getSimpleListFromSql(String dbName, String query) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void executeSql(String db, String query) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public <T> T executeSql(String dbName, String query, Class<T> clazz) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public boolean contains(String db, String table, String column, String value) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public List<Map<?,?>> describeTable(String database, String table) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public String dumpTableAsXML(String db, String t) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public org.dom4j.Document dumpTableAsDoc(String db, String t) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public List<org.dom4j.Document> dumpTableAsList(String db, String t) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public org.dom4j.Document rowToDocument(Map<?,?> map) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public org.dom4j.Document getRowByResourceId(String database, String table, String resourceId) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void importFromIterable(String db, Iterable<String> iterable) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
protected void addOrUpdateRow(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String table, Map<String,Object> rowFields) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
protected void deleteRow(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String table, Map<String,Object> rowFields) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void deleteRowByResourceId(String database, String table, String resourceIdentifier) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void clearTable(String database, String table) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void prepareManagementOfTable(String database, String table) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void removeManagementOfTable(String database, String table) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public boolean isManagedTable(String database, String table) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public boolean isLoggedTable(String database, String table) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public String getDefaultDnetIdentifier(String database, String table) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void reassignDefaultDnetIdentifiers(String db) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void reassignDefaultDnetIdentifiers(String db, String t) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public String getSQLFromTemplate(String sqlTemplate, String db, String table, Map<String,Object> map)
public List<GenericRow> obtainListOfRows(String xml) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
protected boolean parseBoolean(String s)
public void setManaged(String dbName, boolean managed) throws eu.dnetlib.enabling.database.rmi.DatabaseException
eu.dnetlib.enabling.database.rmi.DatabaseException
public void setVelocityEngine(VelocityEngine velocityEngine)
public String getDbPrefix()
public void setDbPrefix(String dbPrefix)
public DataSourceFactory getDataSourceFactory()
public void setDataSourceFactory(DataSourceFactory dataSourceFactory)
public JdbcTemplateFactory getJdbcTemplateFactory()
public void setJdbcTemplateFactory(JdbcTemplateFactory jdbcTemplateFactory)
public TransactionTemplateFactory getTransactionTemplateFactory()
public void setTransactionTemplateFactory(TransactionTemplateFactory transactionTemplateFactory)
public int getNumbersOfRecordsForTransaction()
public void setNumbersOfRecordsForTransaction(int numbersOfRecordsForTransaction)
public String getDefaultDB()
public void setDefaultDB(String defaultDB)
public int getFetchSize()
public void setFetchSize(int fetchSize)
Copyright © 2021. All rights reserved.