Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2012-05-18 16:02:12 +0000
committerMartin Taal2012-05-18 16:02:12 +0000
commit0af5fd778ecb05b024212d59053d2b84f5e9d7aa (patch)
tree5066a60e54e5b88b9c88f4a7546a0ffe206977a3 /hibernate
parent7c538772ac49d40f87ad022c5cb9c35224fbcc76 (diff)
downloadorg.eclipse.emf.teneo-0af5fd778ecb05b024212d59053d2b84f5e9d7aa.tar.gz
org.eclipse.emf.teneo-0af5fd778ecb05b024212d59053d2b84f5e9d7aa.tar.xz
org.eclipse.emf.teneo-0af5fd778ecb05b024212d59053d2b84f5e9d7aa.zip
Updated testcases for Hibernate 4.0
Diffstat (limited to 'hibernate')
-rwxr-xr-xhibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbEntityDataStore.java4
-rwxr-xr-xhibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbSessionWrapper.java7
-rwxr-xr-xhibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/ENumUserIntegerType.java8
3 files changed, 15 insertions, 4 deletions
diff --git a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbEntityDataStore.java b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbEntityDataStore.java
index 739e73082..1b7116d51 100755
--- a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbEntityDataStore.java
+++ b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbEntityDataStore.java
@@ -471,7 +471,9 @@ public class HbEntityDataStore extends HbDataStore implements
}
public void close() {
- delegateEntityManager.close();
+ if (delegateEntityManager.isOpen()) {
+ delegateEntityManager.close();
+ }
}
public boolean contains(Object arg0) {
diff --git a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbSessionWrapper.java b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbSessionWrapper.java
index 0c2152d6c..943403984 100755
--- a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbSessionWrapper.java
+++ b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/HbSessionWrapper.java
@@ -31,6 +31,7 @@ import org.hibernate.metadata.ClassMetadata;
import org.hibernate.persister.entity.JoinedSubclassEntityPersister;
import org.hibernate.persister.entity.SingleTableEntityPersister;
import org.hibernate.persister.entity.UnionSubclassEntityPersister;
+import org.hibernate.service.UnknownServiceException;
/**
* Wraps a standard hibernate session.
@@ -155,7 +156,11 @@ public class HbSessionWrapper implements SessionWrapper {
/** Close the underlying session */
public void close() {
- getSessionInternal().close();
+ try {
+ getSessionInternal().close();
+ } catch (UnknownServiceException e) {
+ // ignore these ones...
+ }
}
/** Save or update the pass object */
diff --git a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/ENumUserIntegerType.java b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/ENumUserIntegerType.java
index 6d3bf5d80..bab290929 100755
--- a/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/ENumUserIntegerType.java
+++ b/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapping/ENumUserIntegerType.java
@@ -13,6 +13,8 @@ import org.eclipse.emf.teneo.classloader.StoreClassLoadException;
import org.eclipse.emf.teneo.hibernate.HbMapperException;
import org.eclipse.emf.teneo.hibernate.mapper.HbMapperConstants;
import org.hibernate.HibernateException;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.internal.SessionImpl;
/**
* Stores a java enum
@@ -34,7 +36,8 @@ public class ENumUserIntegerType extends ENumUserType {
*
* @see org.hibernate.usertype.UserType#nullSafeGet(java.sql.ResultSet, java.lang.String[], java.lang.Object)
*/
- public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
+ @Override
+ public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor sessionImplementor, Object owner) throws HibernateException, SQLException {
final int value = rs.getInt(names[0]);
if (rs.wasNull())
return null;
@@ -61,7 +64,8 @@ public class ENumUserIntegerType extends ENumUserType {
*
* @see org.hibernate.usertype.UserType#nullSafeSet(java.sql.PreparedStatement, java.lang.Object, int)
*/
- public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
+ @Override
+ public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor sessionImplementor) throws HibernateException, SQLException {
if (value == null) {
st.setNull(index, Types.INTEGER);
} else {

Back to the top