Author: epbernard
Date: 2008-03-05 16:57:56 -0500 (Wed, 05 Mar 2008)
New Revision: 14392
Modified:
annotations/trunk/build.xml
annotations/trunk/src/java/org/hibernate/annotations/FlushModeType.java
annotations/trunk/src/java/org/hibernate/annotations/NamedNativeQuery.java
annotations/trunk/src/java/org/hibernate/annotations/NamedQuery.java
annotations/trunk/src/java/org/hibernate/cfg/annotations/QueryBinder.java
annotations/trunk/src/java/org/hibernate/cfg/annotations/Version.java
annotations/trunk/src/test/org/hibernate/test/annotations/query/QueryAndSQLTest.java
Log:
ANN-700 add the notion of persistence context flush mode to delegate query FM to the PC
one
Modified: annotations/trunk/build.xml
===================================================================
--- annotations/trunk/build.xml 2008-03-05 20:21:13 UTC (rev 14391)
+++ annotations/trunk/build.xml 2008-03-05 21:57:56 UTC (rev 14392)
@@ -17,7 +17,7 @@
<!-- Name of project and version, used to create filenames -->
<property name="Name" value="Hibernate Annotations"/>
<property name="name" value="hibernate-annotations"/>
- <property name="version" value="3.3.1.Beta1"/>
+ <property name="version" value="3.3.1.CR1"/>
<property name="javadoc.packagenames"
value="org.hibernate.*"/>
<property name="jdbc.dir" value="jdbc"/>
<property name="copy.test" value="true"/>
Modified: annotations/trunk/src/java/org/hibernate/annotations/FlushModeType.java
===================================================================
--- annotations/trunk/src/java/org/hibernate/annotations/FlushModeType.java 2008-03-05
20:21:13 UTC (rev 14391)
+++ annotations/trunk/src/java/org/hibernate/annotations/FlushModeType.java 2008-03-05
21:57:56 UTC (rev 14392)
@@ -27,5 +27,10 @@
/**
* see {@link org.hibernate.FlushMode.MANUAL}
*/
- MANUAL
+ MANUAL,
+
+ /**
+ * Current flush mode of the persistence context at the time the query is executed
+ */
+ PERSISTENCE_CONTEXT
}
\ No newline at end of file
Modified: annotations/trunk/src/java/org/hibernate/annotations/NamedNativeQuery.java
===================================================================
--- annotations/trunk/src/java/org/hibernate/annotations/NamedNativeQuery.java 2008-03-05
20:21:13 UTC (rev 14391)
+++ annotations/trunk/src/java/org/hibernate/annotations/NamedNativeQuery.java 2008-03-05
21:57:56 UTC (rev 14392)
@@ -22,7 +22,7 @@
String resultSetMapping() default ""; // name of SQLResultSetMapping
/** the flush mode for the query */
- FlushModeType flushMode() default FlushModeType.AUTO;
+ FlushModeType flushMode() default FlushModeType.PERSISTENCE_CONTEXT;
/** mark the query as cacheable or not */
boolean cacheable() default false;
/** the cache region to use */
Modified: annotations/trunk/src/java/org/hibernate/annotations/NamedQuery.java
===================================================================
--- annotations/trunk/src/java/org/hibernate/annotations/NamedQuery.java 2008-03-05
20:21:13 UTC (rev 14391)
+++ annotations/trunk/src/java/org/hibernate/annotations/NamedQuery.java 2008-03-05
21:57:56 UTC (rev 14392)
@@ -21,7 +21,7 @@
/** the Query String for the NamedQuery */
String query();
/** the flush mode for the query */
- FlushModeType flushMode() default FlushModeType.AUTO;
+ FlushModeType flushMode() default FlushModeType.PERSISTENCE_CONTEXT;
/** mark the query as cacheable or not */
boolean cacheable() default false;
/** the cache region to use */
Modified: annotations/trunk/src/java/org/hibernate/cfg/annotations/QueryBinder.java
===================================================================
--- annotations/trunk/src/java/org/hibernate/cfg/annotations/QueryBinder.java 2008-03-05
20:21:13 UTC (rev 14391)
+++ annotations/trunk/src/java/org/hibernate/cfg/annotations/QueryBinder.java 2008-03-05
21:57:56 UTC (rev 14392)
@@ -251,6 +251,9 @@
case MANUAL:
flushMode = FlushMode.MANUAL;
break;
+ case PERSISTENCE_CONTEXT:
+ flushMode = null;
+ break;
default:
throw new AssertionFailure( "Unknown flushModeType: " + flushModeType );
}
Modified: annotations/trunk/src/java/org/hibernate/cfg/annotations/Version.java
===================================================================
--- annotations/trunk/src/java/org/hibernate/cfg/annotations/Version.java 2008-03-05
20:21:13 UTC (rev 14391)
+++ annotations/trunk/src/java/org/hibernate/cfg/annotations/Version.java 2008-03-05
21:57:56 UTC (rev 14392)
@@ -8,7 +8,7 @@
* @author Emmanuel Bernard
*/
public class Version {
- public static final String VERSION = "3.3.1.Beta1";
+ public static final String VERSION = "3.3.1.CR1";
private static Log log = LogFactory.getLog( Version.class );
static {
Modified:
annotations/trunk/src/test/org/hibernate/test/annotations/query/QueryAndSQLTest.java
===================================================================
---
annotations/trunk/src/test/org/hibernate/test/annotations/query/QueryAndSQLTest.java 2008-03-05
20:21:13 UTC (rev 14391)
+++
annotations/trunk/src/test/org/hibernate/test/annotations/query/QueryAndSQLTest.java 2008-03-05
21:57:56 UTC (rev 14392)
@@ -374,7 +374,7 @@
@Override
protected String[] getXmlFiles() {
return new String[]{
- "org/hibernate/test/annotations/query/orm.xml"
+ //"org/hibernate/test/annotations/query/orm.xml"
};
}
}