jvadoc/override
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / database / ICdmDataSource.java
index 694d0367134954457d82e785e00c2f77b4e7660c..60c6fe2565bba049605809248537ad94580624ca 100644 (file)
@@ -13,7 +13,7 @@ import java.sql.DatabaseMetaData;
 import java.sql.ResultSet;\r
 import java.sql.SQLException;\r
 \r
-import org.hibernate.cache.CacheProvider;\r
+import org.hibernate.cache.spi.RegionFactory;\r
 import org.springframework.beans.factory.config.BeanDefinition;\r
 \r
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;\r
@@ -40,7 +40,7 @@ public interface ICdmDataSource {
         * @param cacheProviderClass\r
         * @return BeanDefinition\r
         */\r
-       public BeanDefinition getHibernatePropertiesBean(DbSchemaValidation hbm2dll, Boolean showSql, Boolean formatSql, Boolean registerSearchListener, Class<? extends CacheProvider> cacheProviderClass);\r
+       public BeanDefinition getHibernatePropertiesBean(DbSchemaValidation hbm2dll, Boolean showSql, Boolean formatSql, Boolean registerSearchListener, Class<? extends RegionFactory> cacheProviderClass);\r
 \r
        \r
        /**\r
@@ -56,10 +56,16 @@ public interface ICdmDataSource {
        public String getServer();\r
 \r
        /**\r
+        * Returns the name of the datasource on the given server.\r
         * @return\r
         */\r
        public String getDatabase();\r
        \r
+       /**\r
+        * Returns the database type of the data source. \r
+        * @return the database type of the data source. \r
+        * <code>null</code> if the bean or the driver class property does not exist or the driver class is unknown.\r
+        */\r
        public DatabaseTypeEnum getDatabaseType();\r
        \r
        /**\r
@@ -101,12 +107,33 @@ public interface ICdmDataSource {
      * Executes an update\r
      * @return return code\r
      */\r
-       public int executeUpdate (String sqlUpdate);\r
+       public int executeUpdate (String sqlUpdate) throws SQLException;\r
+       \r
+       /**\r
+        * Starts a transaction for the given datasource.\r
+        */\r
+       public void startTransaction();\r
+       \r
+       /**\r
+        * Commits the transaction for the given datasource.\r
+        * @return\r
+        * @throws SQLException \r
+        */\r
+       public void commitTransaction() throws SQLException;\r
+       \r
+       /**\r
+        * Rolls the connection back.\r
+        * @throws SQLException \r
+        */\r
+       public void rollback() throws SQLException;\r
+\r
 \r
        public NomenclaturalCode getNomenclaturalCode();\r
 \r
        /**\r
-        * Returns a single the first value of a row of a resultset.\r
+        * Returns the first value of the first row of a result set.<BR>\r
+        * If no row exists in the result set\r
+        * <code>null</code> is returned.\r
         * \r
         * <strong>Caution</strong> This method opens a connection on first use. Subsequent calls will use the same connection.\r
         * Please close the connection when not needed anymore with {@link ICdmDataSource#closeOpenConnections()}\r
@@ -133,6 +160,7 @@ public interface ICdmDataSource {
         * \r
         */\r
        public void closeOpenConnections();\r
+\r
        \r
 //\r
 //     public void setFilePath(String filePath);\r