Author: dgeraskov
Date: 2011-12-27 08:12:17 -0500 (Tue, 27 Dec 2011)
New Revision: 37564
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/.classpath
trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
Log:
https://issues.jboss.org/browse/JBIDE-10560
Fixed exception: Inline evaluation error while using criteria editor with Hibernate 4
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/.classpath
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/.classpath 2011-12-23
18:29:41 UTC (rev 37563)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/.classpath 2011-12-27
13:12:17 UTC (rev 37564)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib"
path="lib/required/slf4j-api-1.5.8.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar"
sourcepath="C:/Documents and
Settings/dgeraskov/.m2/repository/org/hibernate/hibernate-entitymanager/4.0.0.CR6/hibernate-entitymanager-4.0.0.CR6-sources.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/required/antlr-2.7.7.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/required/classmate-0.5.4.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/required/commons-collections-3.2.1.jar"/>
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-12-23
18:29:41 UTC (rev 37563)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-12-27
13:12:17 UTC (rev 37564)
@@ -95,28 +95,33 @@
}
@Override
- public QueryResult executeCriteriaQuery(String criteriaCode,
- QueryInputModel model) {
- Session session = null;
- try {
- try {
- session = sessionFactory.openSession();
- return QueryExecutor.executeCriteriaQuery(session, criteriaCode, model);
- } catch (Throwable e){
- //Incompatible library versions could throw subclasses of Error, like
AbstractMethodError
- //may be there is a sense to say to user that the reason is probably a wrong CC
version
- //(when catch a subclass of Error)
- return new QueryResultImpl(e);
- }
- } finally {
- if (session != null && session.isOpen()){
+ public QueryResult executeCriteriaQuery(final String criteriaCode,
+ final QueryInputModel model) {
+ return (QueryResult) execute(new Command() {
+ public Object execute() {
+ Session session = null;
try {
- session.close();
- } catch (HibernateException e) {
- return new QueryResultImpl(e);
- }
+ try {
+ session = sessionFactory.openSession();
+ return QueryExecutor.executeCriteriaQuery(session, criteriaCode, model);
+ } catch (Throwable e){
+ //Incompatible library versions could throw subclasses of Error, like
AbstractMethodError
+ //may be there is a sense to say to user that the reason is probably a wrong CC
version
+ //(when catch a subclass of Error)
+ return new QueryResultImpl(e);
+ }
+ } finally {
+ if (session != null && session.isOpen()){
+ try {
+ session.close();
+ } catch (HibernateException e) {
+ return new QueryResultImpl(e);
+ }
+ }
+ }
}
- }
+ });
+
}
/**