Hibernate SVN: r18533 - annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-13 03:03:57 -0500 (Wed, 13 Jan 2010)
New Revision: 18533
Modified:
annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/Version.java
Log:
JBPAPP-3396 update the version in the pom.xml and readme.txt, changelog and something else
Modified: annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/Version.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/Version.java 2010-01-13 07:55:06 UTC (rev 18532)
+++ annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/Version.java 2010-01-13 08:03:57 UTC (rev 18533)
@@ -8,7 +8,7 @@
* @author Emmanuel Bernard
*/
public class Version {
- public static final String VERSION = "3.4.0.GA";
+ public static final String VERSION = "3.4.0.GA_CP01";
private static Logger log = LoggerFactory.getLogger( Version.class );
static {
14 years, 4 months
Hibernate SVN: r18532 - annotations/branches/v3_4_0_GA_CP.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-13 02:55:06 -0500 (Wed, 13 Jan 2010)
New Revision: 18532
Modified:
annotations/branches/v3_4_0_GA_CP/changelog.txt
annotations/branches/v3_4_0_GA_CP/pom.xml
annotations/branches/v3_4_0_GA_CP/readme.txt
Log:
JBPAPP-3396 update the version in the pom.xml and readme.txt, changelog and something else
Modified: annotations/branches/v3_4_0_GA_CP/changelog.txt
===================================================================
--- annotations/branches/v3_4_0_GA_CP/changelog.txt 2010-01-13 07:53:38 UTC (rev 18531)
+++ annotations/branches/v3_4_0_GA_CP/changelog.txt 2010-01-13 07:55:06 UTC (rev 18532)
@@ -1,6 +1,26 @@
Hibernate Annotations Changelog
===============================
+3.4.0.GA_CP01 (13-01-2010)
+** Bug
+ * [JBPAPP-1061] - ANN-764 - Tests using sequences are run on databases which doesn't supports sequences
+ * [JBPAPP-1068] - Annotations - MSSQL, Oracle - Mapping inconsistency
+ * [JBPAPP-1073] - Annotations - Oracle - "size" is reserved in Oracle
+ * [JBPAPP-1124] - ANN-779 - Oracle - Identifier is too long
+ * [JBPAPP-1125] - ANN - Oracle - Dialect does not support identity key generation
+ * [JBPAPP-1587] - Sybase - Annotations - unit tests using LOBs fail
+ * [JBPAPP-1852] - ANN-778 - Test hangs if an exception is thrown, due to unclosed transaction
+ * [JBPAPP-1878] - ANN-817 - 8-bit characters in string values cause unit test failures
+ * [JBPAPP-1879] - ANN-818 - @DiscriminatorFormula for an integer column with default discriminator type causes failure for DB2/Sybase
+ * [JBPAPP-2082] - ANN-841 - Bidirectional indexed collection mapped incorrectly for IndexedCollectionTest
+ * [JBPAPP-3327] - org.hibernate.test.annotations.EntityTest.testColumn() is incorrect
+ * [JBPAPP-3384] - HHH-4257 map key type no longer inferred correctly, throws exception at runtime
+** Task
+ * [JBPAPP-2923] - CLONE -Modify Annotations, Entity Manager, and Search to work with the same property settings as Core
+ * [JBPAPP-3217] - enable test case on others db
+ * [JBPAPP-3150] - change the build tool of Hibernate Annotations(eap 5 cp branch)
+
+
3.4.0.GA (20-08-2008)
----------------------
Modified: annotations/branches/v3_4_0_GA_CP/pom.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/pom.xml 2010-01-13 07:53:38 UTC (rev 18531)
+++ annotations/branches/v3_4_0_GA_CP/pom.xml 2010-01-13 07:55:06 UTC (rev 18532)
@@ -33,7 +33,7 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<packaging>jar</packaging>
- <version>3.4.0.GA</version>
+ <version>3.4.0.GA_CP01</version>
<name>Hibernate Annotations</name>
<description>Annotations metadata for Hibernate</description>
@@ -103,7 +103,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
- <version>3.3.2.GA</version>
+ <version>3.3.2.GA_CP01</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
Modified: annotations/branches/v3_4_0_GA_CP/readme.txt
===================================================================
--- annotations/branches/v3_4_0_GA_CP/readme.txt 2010-01-13 07:53:38 UTC (rev 18531)
+++ annotations/branches/v3_4_0_GA_CP/readme.txt 2010-01-13 07:55:06 UTC (rev 18532)
@@ -1,8 +1,8 @@
Hibernate Annotations
==================================================
-Version: @version@, @releasedate@
+Version: 3.4.0.GA_CP01, 2010.01.13
-THIS RELEASE OF HIBERNATE ANNOTATIONS REQUIRES HIBERNATE CORE 3.3 (and above)
+THIS RELEASE OF HIBERNATE ANNOTATIONS REQUIRES HIBERNATE CORE 3.3.2.GA_CP01 (and above)
Description
-----------
14 years, 4 months
Hibernate SVN: r18531 - in core/branches/Branch_3_3_2_GA_CP: parent and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-13 02:53:38 -0500 (Wed, 13 Jan 2010)
New Revision: 18531
Modified:
core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
core/branches/Branch_3_3_2_GA_CP/pom.xml
Log:
JBPAPP-3396 update the version in the pom.xml and readme.txt, changelog and something else
Modified: core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
+++ core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-01-13 07:53:38 UTC (rev 18531)
@@ -811,6 +811,5 @@
</profiles>
<properties>
<slf4jVersion>1.5.8</slf4jVersion>
- <parentVersion>3.3.2.GA_CP01</parentVersion>
</properties>
</project>
Modified: core/branches/Branch_3_3_2_GA_CP/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
+++ core/branches/Branch_3_3_2_GA_CP/pom.xml 2010-01-13 07:53:38 UTC (rev 18531)
@@ -103,5 +103,7 @@
</modules>
</profile>
</profiles>
-
+ <properties>
+ <parentVersion>3.3.2.GA_CP01</parentVersion>
+ </properties>
</project>
\ No newline at end of file
14 years, 4 months
Hibernate SVN: r18530 - in core/branches/Branch_3_3_2_GA_CP: cache-ehcache and 18 other directories.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-13 02:31:11 -0500 (Wed, 13 Jan 2010)
New Revision: 18530
Modified:
core/branches/Branch_3_3_2_GA_CP/cache-ehcache/pom.xml
core/branches/Branch_3_3_2_GA_CP/cache-jbosscache/pom.xml
core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/pom.xml
core/branches/Branch_3_3_2_GA_CP/cache-oscache/pom.xml
core/branches/Branch_3_3_2_GA_CP/cache-swarmcache/pom.xml
core/branches/Branch_3_3_2_GA_CP/changelog.txt
core/branches/Branch_3_3_2_GA_CP/connection-c3p0/pom.xml
core/branches/Branch_3_3_2_GA_CP/connection-proxool/pom.xml
core/branches/Branch_3_3_2_GA_CP/core/pom.xml
core/branches/Branch_3_3_2_GA_CP/distribution/pom.xml
core/branches/Branch_3_3_2_GA_CP/documentation/manual/pom.xml
core/branches/Branch_3_3_2_GA_CP/documentation/pom.xml
core/branches/Branch_3_3_2_GA_CP/hibernate-maven-plugin/pom.xml
core/branches/Branch_3_3_2_GA_CP/jmx/pom.xml
core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
core/branches/Branch_3_3_2_GA_CP/pom.xml
core/branches/Branch_3_3_2_GA_CP/testing/pom.xml
core/branches/Branch_3_3_2_GA_CP/testsuite/pom.xml
core/branches/Branch_3_3_2_GA_CP/tutorials/eg/pom.xml
core/branches/Branch_3_3_2_GA_CP/tutorials/pom.xml
core/branches/Branch_3_3_2_GA_CP/tutorials/web/pom.xml
Log:
JBPAPP-3396 update the version in the pom.xml and readme.txt, changelog and something else
Modified: core/branches/Branch_3_3_2_GA_CP/cache-ehcache/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/cache-ehcache/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/cache-ehcache/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/cache-jbosscache/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/cache-jbosscache/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/cache-jbosscache/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/cache-jbosscache2/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/cache-oscache/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/cache-oscache/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/cache-oscache/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/cache-swarmcache/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/cache-swarmcache/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/cache-swarmcache/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/changelog.txt
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/changelog.txt 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/changelog.txt 2010-01-13 07:31:11 UTC (rev 18530)
@@ -6,6 +6,51 @@
more about each case.
+Changes in version 3.3.2.GA_CP01 (2010.01.13)
+------------------------------------------------
+
+** Bug
+ * [JBPAPP-1547] - HHH-3686 - Sybase - QueryCacheTest.testQueryCacheInvalidation fails
+ * [JBPAPP-2277] - CLONE -HHH-2990 - Bad usage of ClassLoader.loadClass() for Java6 in SerializationHelper$CustomObjectInputStream - deserialization bottleneck for arrays
+ * [JBPAPP-2408] - Bug in DB2 9.7 driver affects Hibernate's "native" ID generator
+ * [JBPAPP-2716] - Core - FooBarTest - "operator does not exist: character varying = integer"
+ * [JBPAPP-2791] - CLONE -HHH-4457 - SchemaUpdate fails on Sybase ASE 15 when a new column is added without a default value
+ * [JBPAPP-2858] - HHH-4463 Native queries should not be automatically paginated in getSingleResult() as it fails for some DB and or queries
+ * [JBPAPP-2892] - DataVersioningException when using EJB3 entities with OPTIMISTIC caching
+ * [JBPAPP-2900] - HHH-4486 - Account for MySQL's <DROP TEMPORARY TABLE> statement
+ * [JBPAPP-2910] - hhh-4415 TestCase could check for superclass of Dialect before skipping it
+ * [JBPAPP-2922] - HHH-4494 - cglib log warning says BytecodeProvider impl is considered deprecated
+ * [JBPAPP-2957] - HHH-3818 Hibernate/JBC integration doesn't property handle Entity/CollectionRegionAccessStrategy evict
+ * [JBPAPP-3067] - HHH-4576 - Tests in MySQL using different case for objects as defined in configuration
+ * [JBPAPP-3078] - Test JMSMasterTest contains invalid SQL statement
+ * [JBPAPP-3089] - HHH-2166 - Long "in" lists in queries results in a Java stack overflow exception.
+ * [JBPAPP-3098] - HHH-4065 - Incorrect SQL is used for HQL if the number of values for a filter collection parameter is changed
+ * [JBPAPP-3116] - update hibernate annotations dependency of core
+ * [JBPAPP-3162] - hibernate core distro does not contains asm
+ * [JBPAPP-3173] - HHH-4614 (javassist)Instrumented model with abstract MappedSuperclass and field access doesn't work
+ * [JBPAPP-3209] - HHH-4625 Use of maven-injection-plugin intermittently leads to build failures
+ * [JBPAPP-3223] - HHH-3164 "id in ..." with EmbeddedId and criteria API
+ * [JBPAPP-3224] - update hibernate entitymanager dependency of core
+ * [JBPAPP-3310] - HHH-4741 org.hibernate.test.filter.DynamicFilterTest.testSqlSyntaxOfFiltersWithUnions fails on MySQL
+ * [JBPAPP-3312] - org.hibernate.test.legacy.CustomSQLTest fails
+ * [JBPAPP-3313] - org.hibernate.test.stateless.fetching.StatelessSessionFetchingTest.testDynamicFetch fails on PostgreSQL
+ * [JBPAPP-3315] - default batch_versioned_data =true cause two test case fails on oracle
+ * [JBPAPP-3317] - exclude postgresql and oracle in the test of org.hibernate.test.cascade.BidirectionalOneToManyCascadeTest.testSaveOrphanDeleteChildWithParentFailureExpected
+ * [JBPAPP-3321] - keywords 'on oracle cause test cases fail
+ * [JBPAPP-3323] - org.hibernate.test.legacy.SQLFunctionsTest.testDialectSQLFunctions fails on oracle
+ * [JBPAPP-3325] - org.hibernate.test.legacy.CustomSQLTest.testInsert fails on most of DBs
+ * [JBPAPP-3371] - HHH-4769 on MySQL, HQL function ROUND always returns an Integer, it truncate the decimal part of Double number.
+ * [JBPAPP-3372] - HHH-4764 org.hibernate.test.pagination.PaginationTest.testLimitOffset() fails on oracle and db2
+ * [JBPAPP-3375] - HHH-4773 unit tests fail cos db2 doesn't allow primary key column nullable
+ * [JBPAPP-3378] - non-utf8 data cause tests fail on sybase
+ * [JBPAPP-3379] - default hibernate.jdbc.use_streams_for_binary cause two test cases fail on db2
+
+** Task
+ * [JBPAPP-3115] - update HREFs for JDK from jdk1.4 to jdk1.5
+ * [JBPAPP-3218] - update db profile in hibernate eap 5 cp branch
+ * [JBPAPP-3360] - enable show_sql property and update log4j.properties to show some more useful log
+
+
Changes in version 3.3.2.GA (2009.06.24)
-------------------------------------------
Modified: core/branches/Branch_3_3_2_GA_CP/connection-c3p0/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/connection-c3p0/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/connection-c3p0/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/connection-proxool/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/connection-proxool/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/connection-proxool/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/core/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/core/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/distribution/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/distribution/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/distribution/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -32,7 +32,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/documentation/manual/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/documentation/manual/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/documentation/manual/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/documentation/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/documentation/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/documentation/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/hibernate-maven-plugin/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/hibernate-maven-plugin/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/hibernate-maven-plugin/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -29,7 +29,7 @@
<parent>
<artifactId>hibernate-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/jmx/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/jmx/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/jmx/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/parent/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/parent/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -32,7 +32,7 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
<packaging>pom</packaging>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<name>Hibernate Core Parent POM</name>
<description>The base POM for all Hibernate Core modules.</description>
@@ -53,9 +53,9 @@
</licenses>
<scm>
- <connection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA</developerConnection>
- <url>https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA</url>
+ <connection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.G...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.G...</developerConnection>
+ <url>https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA_CP01</url>
</scm>
<ciManagement>
@@ -811,5 +811,6 @@
</profiles>
<properties>
<slf4jVersion>1.5.8</slf4jVersion>
+ <parentVersion>3.3.2.GA_CP01</parentVersion>
</properties>
</project>
Modified: core/branches/Branch_3_3_2_GA_CP/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -32,7 +32,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>parent/pom.xml</relativePath>
</parent>
@@ -70,9 +70,9 @@
from Branch_3_3/hibernate (the artifactId of this aggregator module).
-->
<scm>
- <connection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA</developerConnection>
- <url>https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA</url>
+ <connection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.G...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.G...</developerConnection>
+ <url>https://svn.jboss.org/repos/hibernate/core/tags/hibernate-3.3.2.GA_CP01</url>
</scm>
<build>
Modified: core/branches/Branch_3_3_2_GA_CP/testing/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testing/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/testing/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/testsuite/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/tutorials/eg/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/tutorials/eg/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/tutorials/eg/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -32,7 +32,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/tutorials/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/tutorials/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/tutorials/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -31,7 +31,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/branches/Branch_3_3_2_GA_CP/tutorials/web/pom.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/tutorials/web/pom.xml 2010-01-13 06:59:54 UTC (rev 18529)
+++ core/branches/Branch_3_3_2_GA_CP/tutorials/web/pom.xml 2010-01-13 07:31:11 UTC (rev 18530)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.3.2.GA</version>
+ <version>${parentVersion}</version>
<relativePath>../pom.xml</relativePath>
</parent>
14 years, 4 months
Hibernate SVN: r18529 - core/trunk/core/src/main/java/org/hibernate/persister/entity.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-13 01:59:54 -0500 (Wed, 13 Jan 2010)
New Revision: 18529
Modified:
core/trunk/core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java
Log:
HHH-3338 : Order of attributes in generated SQL query is dependent on Java version
Modified: core/trunk/core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java 2010-01-13 06:02:14 UTC (rev 18528)
+++ core/trunk/core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java 2010-01-13 06:59:54 UTC (rev 18529)
@@ -30,6 +30,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.ArrayList;
+import java.util.LinkedHashSet;
import org.hibernate.AssertionFailure;
import org.hibernate.Hibernate;
@@ -390,7 +391,7 @@
);
}
- HashSet columns = new HashSet();
+ HashSet columns = new LinkedHashSet();
Iterator titer = model.getSubclassTableClosureIterator();
while ( titer.hasNext() ) {
Table table = (Table) titer.next();
14 years, 4 months
Hibernate SVN: r18528 - in core/trunk/core/src/main/java/org/hibernate: engine and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-13 01:02:14 -0500 (Wed, 13 Jan 2010)
New Revision: 18528
Modified:
core/trunk/core/src/main/java/org/hibernate/action/EntityDeleteAction.java
core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java
core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java
core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultEvictEventListener.java
Log:
HHH-4737 : Cache the EntityKey in EntityEntry when id is non-null
Modified: core/trunk/core/src/main/java/org/hibernate/action/EntityDeleteAction.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/action/EntityDeleteAction.java 2010-01-13 03:03:49 UTC (rev 18527)
+++ core/trunk/core/src/main/java/org/hibernate/action/EntityDeleteAction.java 2010-01-13 06:02:14 UTC (rev 18528)
@@ -108,9 +108,8 @@
}
entry.postDelete();
- EntityKey key = new EntityKey( entry.getId(), entry.getPersister(), session.getEntityMode() );
- persistenceContext.removeEntity(key);
- persistenceContext.removeProxy(key);
+ persistenceContext.removeEntity( entry.getEntityKey() );
+ persistenceContext.removeProxy( entry.getEntityKey() );
if ( persister.hasCache() ) {
persister.getCacheAccessStrategy().remove( ck );
Modified: core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java 2010-01-13 03:03:49 UTC (rev 18527)
+++ core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java 2010-01-13 06:02:14 UTC (rev 18528)
@@ -56,6 +56,7 @@
private transient EntityPersister persister; // for convenience to save some lookups
private final EntityMode entityMode;
private final String entityName;
+ private transient EntityKey cachedEntityKey; // cached EntityKey (lazy-initialized)
private boolean isBeingReplicated;
private boolean loadedWithLazyPropertiesUnfetched; //NOTE: this is not updated when properties are fetched lazily!
private final transient Object rowId;
@@ -165,6 +166,21 @@
return persister;
}
+ /**
+ * Get the EntityKey based on this EntityEntry.
+ * @return the EntityKey
+ * @throws IllegalStateException if getId() is null
+ */
+ public EntityKey getEntityKey() {
+ if ( cachedEntityKey == null ) {
+ if ( getId() == null ) {
+ throw new IllegalStateException( "cannot generate an EntityKey when id is null.");
+ }
+ cachedEntityKey = new EntityKey( getId(), getPersister(), entityMode );
+ }
+ return cachedEntityKey;
+ }
+
void afterDeserialize(SessionFactoryImplementor factory) {
persister = factory.getEntityPersister( entityName );
}
@@ -225,7 +241,7 @@
earlyInsert ?
!isExistsInDatabase() :
session.getPersistenceContext().getNullifiableEntityKeys()
- .contains( new EntityKey( getId(), getPersister(), entityMode ) )
+ .contains( getEntityKey() )
);
}
Modified: core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java 2010-01-13 03:03:49 UTC (rev 18527)
+++ core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java 2010-01-13 06:02:14 UTC (rev 18528)
@@ -698,8 +698,7 @@
*/
public Object proxyFor(Object impl) throws HibernateException {
EntityEntry e = getEntry(impl);
- EntityPersister p = e.getPersister();
- return proxyFor( p, new EntityKey( e.getId(), p, session.getEntityMode() ), impl );
+ return proxyFor( e.getPersister(), e.getEntityKey(), impl );
}
/**
Modified: core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java 2010-01-13 03:03:49 UTC (rev 18527)
+++ core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java 2010-01-13 06:02:14 UTC (rev 18528)
@@ -191,10 +191,7 @@
}
boolean isReallyReadOnly = readOnly || !persister.isMutable();
- Object proxy = persistenceContext.getProxy(
- new EntityKey(entityEntry.getId(), entityEntry.getPersister(), session.getEntityMode()
- )
- );
+ Object proxy = persistenceContext.getProxy( entityEntry.getEntityKey() );
if ( proxy != null ) {
// there is already a proxy for this impl
// only set the status to read-only if the proxy is read-only
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/DefaultEvictEventListener.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/DefaultEvictEventListener.java 2010-01-13 03:03:49 UTC (rev 18527)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/DefaultEvictEventListener.java 2010-01-13 06:02:14 UTC (rev 18528)
@@ -88,9 +88,8 @@
else {
EntityEntry e = persistenceContext.removeEntry( object );
if ( e != null ) {
- EntityKey key = new EntityKey( e.getId(), e.getPersister(), source.getEntityMode() );
- persistenceContext.removeEntity( key );
- doEvict( object, key, e.getPersister(), source );
+ persistenceContext.removeEntity( e.getEntityKey() );
+ doEvict( object, e.getEntityKey(), e.getPersister(), source );
}
}
}
14 years, 4 months
Hibernate SVN: r18527 - annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-12 22:03:49 -0500 (Tue, 12 Jan 2010)
New Revision: 18527
Modified:
annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/MapBinder.java
Log:
JBPAPP-3384 HHH-4257 map key type no longer inferred correctly, throws exception at runtime
Modified: annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/MapBinder.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/MapBinder.java 2010-01-13 03:02:51 UTC (rev 18526)
+++ annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/MapBinder.java 2010-01-13 03:03:49 UTC (rev 18527)
@@ -239,6 +239,9 @@
if (mapKeyAnn != null && ! BinderHelper.isDefault( mapKeyAnn.type().type() ) ) {
elementBinder.setExplicitType( mapKeyAnn.type() );
}
+ else{
+ elementBinder.setType( property , elementClass );
+ }
mapValue.setIndex( elementBinder.make() );
}
}
14 years, 4 months
Hibernate SVN: r18526 - annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-12 22:02:51 -0500 (Tue, 12 Jan 2010)
New Revision: 18526
Modified:
annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/MapBinder.java
Log:
JBPAPP-3384 HHH-4257 map key type no longer inferred correctly, throws exception at runtime
Modified: annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/MapBinder.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/MapBinder.java 2010-01-13 01:04:55 UTC (rev 18525)
+++ annotations/branches/v3_4_0_GA_CP/src/main/java/org/hibernate/cfg/annotations/MapBinder.java 2010-01-13 03:02:51 UTC (rev 18526)
@@ -110,7 +110,7 @@
}
else {
//this is a true Map mapping
- //TODO ugly copy/pastle from CollectionBinder.bindManyToManySecondPass
+ //TODO ugly copy/paste from CollectionBinder.bindManyToManySecondPass
String mapKeyType;
Class target = void.class;
/*
@@ -239,12 +239,15 @@
if (mapKeyAnn != null && ! BinderHelper.isDefault( mapKeyAnn.type().type() ) ) {
elementBinder.setExplicitType( mapKeyAnn.type() );
}
+ else{
+ elementBinder.setType( property , elementClass );
+ }
mapValue.setIndex( elementBinder.make() );
}
}
//FIXME pass the Index Entity JoinColumns
if ( !collection.isOneToMany() ) {
- //index column shoud not be null
+ //index column should not be null
for (Ejb3JoinColumn col : mapKeyManyToManyColumns) {
col.forceNotNull();
}
14 years, 4 months
Hibernate SVN: r18525 - in core/trunk: core/src/main/java/org/hibernate/engine and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-12 20:04:55 -0500 (Tue, 12 Jan 2010)
New Revision: 18525
Added:
core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java
Modified:
core/trunk/core/src/main/java/org/hibernate/Session.java
core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java
core/trunk/core/src/main/java/org/hibernate/engine/PersistenceContext.java
core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java
core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java
core/trunk/core/src/main/java/org/hibernate/impl/SessionImpl.java
core/trunk/core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java
core/trunk/core/src/main/java/org/hibernate/proxy/LazyInitializer.java
core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java
Log:
Session.setReadOnly(Object, boolean) fails for proxies
Modified: core/trunk/core/src/main/java/org/hibernate/Session.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/Session.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/Session.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -839,15 +839,29 @@
* Get the statistics for this session.
*/
public SessionStatistics getStatistics();
-
+
/**
- * Set an unmodified persistent object to read only mode, or a read only
- * object to modifiable mode. In read only mode, no snapshot is maintained
+ * Is the specified entity or proxy read-only?
+ * @param entityOrProxy, an entity or HibernateProxy
+ * @return true, the entity or proxy is read-only;
+ * false, the entity or proxy is modifiable.
+ */
+ public boolean isReadOnly(Object entityOrProxy);
+
+ /**
+ * Set an unmodified persistent object to read-only mode, or a read-only
+ * object to modifiable mode. In read-only mode, no snapshot is maintained
* and the instance is never dirty checked.
+ *
+ * If the entity or proxy already has the specified read-only/modifiable
+ * setting, then this method does nothing.
*
+ * @param entityOrProxy, an entity or HibernateProxy
+ * @param readOnly, if true, the entity or proxy is made read-only;
+ * if false, the entity or proxy is made modifiable.
* @see Query#setReadOnly(boolean)
*/
- public void setReadOnly(Object entity, boolean readOnly);
+ public void setReadOnly(Object entityOrProxy, boolean readOnly);
/**
* Controller for allowing users to perform JDBC related work using the Connection
Modified: core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/engine/EntityEntry.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -261,22 +261,25 @@
);
}
+ public boolean isReadOnly() {
+ if (status != Status.MANAGED && status != Status.READ_ONLY) {
+ throw new HibernateException("instance was not in a valid state");
+ }
+ return status == Status.READ_ONLY;
+ }
+
public void setReadOnly(boolean readOnly, Object entity) {
- if ( ( readOnly && status == Status.READ_ONLY ) ||
- ( ( ! readOnly ) && status == Status.MANAGED ) ) {
+ if ( readOnly == isReadOnly() ) {
// simply return since the status is not being changed
return;
}
- if (status!=Status.MANAGED && status!=Status.READ_ONLY) {
- throw new HibernateException("instance was not in a valid state");
- }
- if (readOnly) {
- setStatus(Status.READ_ONLY);
+ if ( readOnly ) {
+ setStatus( Status.READ_ONLY );
loadedState = null;
}
else {
- setStatus(Status.MANAGED);
- loadedState = getPersister().getPropertyValues(entity, entityMode);
+ setStatus( Status.MANAGED );
+ loadedState = getPersister().getPropertyValues( entity, entityMode );
}
}
Modified: core/trunk/core/src/main/java/org/hibernate/engine/PersistenceContext.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/PersistenceContext.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/engine/PersistenceContext.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -475,12 +475,27 @@
* Is the association property belonging to the keyed entity null?
*/
public boolean isPropertyNull(EntityKey ownerKey, String propertyName);
-
+
/**
- * Set the object to read only and discard it's snapshot
+ * Is the entity or proxy read-only?
+ *
+ * @param entityOrProxy
+ * @return true, the object is read-only; false, the object is modifiable.
*/
- public void setReadOnly(Object entity, boolean readOnly);
+ public boolean isReadOnly(Object entityOrProxy);
+ /**
+ * Set the entity or proxy to read only and discard it's snapshot.
+ *
+ * If the entity or proxy already has the specified read-only/modifiable
+ * setting, then this method does nothing.
+ *
+ * @param entityOrProxy, an entity or HibernateProxy
+ * @param readOnly, if true, the entity or proxy is made read-only;
+ * if false, the entity or proxy is made modifiable.
+ */
+ public void setReadOnly(Object entityOrProxy, boolean readOnly);
+
void replaceDelayedEntityIdentityInsertKeys(EntityKey oldKey, Serializable generatedId);
/**
Modified: core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -1302,13 +1302,67 @@
nullAssociations.clear();
}
- public void setReadOnly(Object entity, boolean readOnly) {
+ public boolean isReadOnly(Object entityOrProxy) {
+ if ( entityOrProxy == null ) {
+ throw new AssertionFailure( "object must be non-null." );
+ }
+ boolean isReadOnly;
+ if ( entityOrProxy instanceof HibernateProxy ) {
+ isReadOnly = ( ( HibernateProxy ) entityOrProxy ).getHibernateLazyInitializer().isReadOnly();
+ }
+ else {
+ EntityEntry ee = getEntry( entityOrProxy );
+ if ( ee == null ) {
+ throw new TransientObjectException("Instance was not associated with this persistence context" );
+ }
+ isReadOnly = ee.isReadOnly();
+ }
+ return isReadOnly;
+ }
+
+ public void setReadOnly(Object object, boolean readOnly) {
+ if ( object == null ) {
+ throw new AssertionFailure( "object must be non-null." );
+ }
+ if ( isReadOnly( object ) == readOnly ) {
+ return;
+ }
+ if ( object instanceof HibernateProxy ) {
+ HibernateProxy proxy = ( HibernateProxy ) object;
+ setProxyReadOnly( proxy, readOnly );
+ if ( Hibernate.isInitialized( proxy ) ) {
+ setEntityReadOnly(
+ proxy.getHibernateLazyInitializer().getImplementation(),
+ readOnly
+ );
+ }
+ }
+ else {
+ setEntityReadOnly( object, readOnly );
+ // PersistenceContext.proxyFor( entity ) returns entity if there is no proxy for that entity
+ // so need to check the return value to be sure it is really a proxy
+ Object maybeProxy = getSession().getPersistenceContext().proxyFor( object );
+ if ( maybeProxy instanceof HibernateProxy ) {
+ setProxyReadOnly( ( HibernateProxy ) maybeProxy, readOnly );
+ }
+ }
+ }
+
+ private void setProxyReadOnly(HibernateProxy proxy, boolean readOnly) {
+ if ( proxy.getHibernateLazyInitializer().getSession() != getSession() ) {
+ throw new AssertionFailure(
+ "Attempt to set a proxy to read-only that is associated with a different session" );
+ }
+ proxy.getHibernateLazyInitializer().setReadOnly( readOnly );
+ }
+
+ private void setEntityReadOnly(Object entity, boolean readOnly) {
EntityEntry entry = getEntry(entity);
- if (entry==null) {
- throw new TransientObjectException("Instance was not associated with the session");
+ if (entry == null) {
+ throw new TransientObjectException("Instance was not associated with this persistence context" );
}
- entry.setReadOnly(readOnly, entity);
- hasNonReadOnlyEntities = hasNonReadOnlyEntities || !readOnly;
+ entry.setReadOnly(readOnly, entity );
+ hasNonReadOnlyEntities = hasNonReadOnlyEntities || ! readOnly;
}
public void replaceDelayedEntityIdentityInsertKeys(EntityKey oldKey, Serializable generatedId) {
Modified: core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -32,6 +32,7 @@
import org.hibernate.CacheMode;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
+import org.hibernate.proxy.HibernateProxy;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.entry.CacheEntry;
import org.hibernate.event.PostLoadEvent;
@@ -188,8 +189,18 @@
factory.getStatisticsImplementor().secondLevelCachePut( persister.getCacheAccessStrategy().getRegion().getName() );
}
}
-
- if ( readOnly || !persister.isMutable() ) {
+
+ boolean isReallyReadOnly = readOnly || !persister.isMutable();
+ Object proxy = persistenceContext.getProxy(
+ new EntityKey(entityEntry.getId(), entityEntry.getPersister(), session.getEntityMode()
+ )
+ );
+ if ( proxy != null ) {
+ // there is already a proxy for this impl
+ // only set the status to read-only if the proxy is read-only
+ isReallyReadOnly = ( ( HibernateProxy ) proxy ).getHibernateLazyInitializer().isReadOnly();
+ }
+ if ( isReallyReadOnly ) {
//no need to take a snapshot - this is a
//performance optimization, but not really
//important, except for entities with huge
Modified: core/trunk/core/src/main/java/org/hibernate/impl/SessionImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/impl/SessionImpl.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/impl/SessionImpl.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -1956,6 +1956,12 @@
return true;
}
+ public boolean isReadOnly(Object entityOrProxy) {
+ errorIfClosed();
+ checkTransactionSynchStatus();
+ return persistenceContext.isReadOnly( entityOrProxy );
+ }
+
public void setReadOnly(Object entity, boolean readOnly) {
errorIfClosed();
checkTransactionSynchStatus();
Modified: core/trunk/core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -28,6 +28,8 @@
import org.hibernate.HibernateException;
import org.hibernate.LazyInitializationException;
+import org.hibernate.TransientObjectException;
+import org.hibernate.SessionException;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.SessionImplementor;
@@ -43,8 +45,8 @@
private Serializable id;
private Object target;
private boolean initialized;
+ private boolean readOnly;
private boolean unwrap;
-
private transient SessionImplementor session;
/**
@@ -63,7 +65,15 @@
protected AbstractLazyInitializer(String entityName, Serializable id, SessionImplementor session) {
this.entityName = entityName;
this.id = id;
- this.session = session;
+ // initialize other fields depending on session state
+ if ( session == null ) {
+ // would be better to call unsetSession(), but it is not final...
+ session = null;
+ readOnly = false;
+ }
+ else {
+ setSession( session );
+ }
}
/**
@@ -108,7 +118,9 @@
if ( s != session ) {
// check for s == null first, since it is least expensive
if ( s == null ){
- unsetSession();
+ // would be better to call unsetSession(), but it is not final...
+ session = null;
+ readOnly = false;
}
else if ( isConnectedToSession() ) {
//TODO: perhaps this should be some other RuntimeException...
@@ -116,6 +128,8 @@
}
else {
session = s;
+ // NOTE: the proxy may not be connected to the session yet, so set readOnly directly
+ readOnly = ! session.getFactory().getEntityPersister( entityName ).isMutable();
}
}
}
@@ -132,6 +146,7 @@
*/
public void unsetSession() {
session = null;
+ readOnly = false;
}
/**
@@ -223,6 +238,48 @@
/**
* {@inheritDoc}
*/
+ public boolean isReadOnly() {
+ errorIfReadOnlySettingNotAvailable();
+ if ( !isConnectedToSession() ) {
+ throw new TransientObjectException(
+ "The read-only/modifiable setting is only accessible when the proxy is associated with a session." );
+ }
+ return readOnly;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setReadOnly(boolean readOnly) {
+ errorIfReadOnlySettingNotAvailable();
+ // only update if readOnly is different from current setting
+ if ( this.readOnly != readOnly ) {
+ Object proxy = getProxyOrNull();
+ if ( proxy == null ) {
+ throw new TransientObjectException(
+ "Cannot set the read-only/modifiable mode unless the proxy is associated with a session." );
+ }
+ this.readOnly = readOnly;
+ if ( initialized ) {
+ session.getPersistenceContext().setReadOnly( target, readOnly );
+ }
+ }
+ }
+
+ private void errorIfReadOnlySettingNotAvailable() {
+ if ( session == null ) {
+ throw new TransientObjectException(
+ "Proxy is detached (i.e, session is null). The read-only/modifiable setting is only accessible when the proxy is associated with an open session." );
+ }
+ if ( session.isClosed() ) {
+ throw new SessionException(
+ "Session is closed. The read-only/modifiable setting is only accessible when the proxy is associated with an open session." );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public boolean isUnwrap() {
return unwrap;
}
Modified: core/trunk/core/src/main/java/org/hibernate/proxy/LazyInitializer.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/proxy/LazyInitializer.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/core/src/main/java/org/hibernate/proxy/LazyInitializer.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -105,6 +105,37 @@
public void setImplementation(Object target);
/**
+ * Is the proxy read-only?.
+ *
+ * @return true, if this proxy is read-only; false, otherwise
+ * @throws org.hibernate.TransientObjectException if the proxy is not association with a session
+ * @throws org.hibernate.SessionException if the proxy is associated with a sesssion that is closed
+ *
+ * @see org.hibernate.Session#isReadOnly(Object entityOrProxy)
+ */
+ public boolean isReadOnly();
+
+ /**
+ * Set an associated modifiable proxy to read-only mode, or a read-only
+ * proxy to modifiable mode. If the proxy is currently initialized, its
+ * implementation will be set to the same mode; otherwise, when the
+ * proxy is initialized, its implementation will have the same read-only/
+ * modifiable setting as the proxy. In read-only mode, no snapshot is
+ * maintained and the instance is never dirty checked.
+ *
+ * If the associated proxy already has the specified read-only/modifiable
+ * setting, then this method does nothing.
+ *
+ * @param readOnly, if true, the associated proxy is made read-only;
+ * if false, the associated proxy is made modifiable.
+ * @throws org.hibernate.TransientObjectException if the proxy is not association with a session
+ * @throws org.hibernate.SessionException if the proxy is associated with a sesssion that is closed
+ *
+ * @see org.hibernate.Session#setReadOnly(Object entityOrProxy, boolean readOnly)
+ */
+ public void setReadOnly(boolean readOnly);
+
+ /**
* Get the session to which this proxy is associated, or null if it is not attached.
*
* @return The associated session.
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -0,0 +1,1491 @@
+//$Id: ReadOnlyTest.java 10977 2006-12-12 23:28:04Z steve.ebersole(a)jboss.com $
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.test.readonly;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.hibernate.CacheMode;
+import org.hibernate.Hibernate;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.TransientObjectException;
+import org.hibernate.SessionException;
+import org.hibernate.engine.SessionImplementor;
+import org.hibernate.proxy.HibernateProxy;
+import org.hibernate.proxy.LazyInitializer;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+
+/**
+ * Tests making initialized and uninitialized proxies read-only/modifiable
+ *
+ * @author Gail Badner
+ */
+public class ReadOnlyProxyTest extends FunctionalTestCase {
+
+ public ReadOnlyProxyTest(String str) {
+ super(str);
+ }
+
+ public String[] getMappings() {
+ return new String[] { "readonly/DataPoint.hbm.xml", "readonly/TextHolder.hbm.xml" };
+ }
+
+ public void configure(Configuration cfg) {
+ cfg.setProperty(Environment.STATEMENT_BATCH_SIZE, "20");
+ }
+
+ public String getCacheConcurrencyStrategy() {
+ return null;
+ }
+
+ public static Test suite() {
+ return new FunctionalTestClassTestSuite( ReadOnlyProxyTest.class );
+ }
+
+ public void testReadOnlyViaSessionDoesNotInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp, true );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.setReadOnly( dp, false );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.flush();
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.getTransaction().commit();
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyViaLazyInitializerDoesNotInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ LazyInitializer dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ dpLI.setReadOnly( true );
+ checkReadOnly( s, dp, true );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ dpLI.setReadOnly( false );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.flush();
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.getTransaction().commit();
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyViaSessionNoChangeAfterInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp, true );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, true );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp, true );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ s.setReadOnly( dp, false );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyViaLazyInitializerNoChangeAfterInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ LazyInitializer dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ checkReadOnly( s, dp, false );
+ assertTrue( dpLI.isUninitialized() );
+ Hibernate.initialize( dp );
+ assertFalse( dpLI.isUninitialized() );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ dpLI.setReadOnly( true );
+ checkReadOnly( s, dp, true );
+ assertTrue( dpLI.isUninitialized() );
+ Hibernate.initialize( dp );
+ assertFalse( dpLI.isUninitialized() );
+ checkReadOnly( s, dp, true );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ dpLI.setReadOnly( true );
+ checkReadOnly( s, dp, true );
+ assertTrue( dpLI.isUninitialized() );
+ dpLI.setReadOnly( false );
+ checkReadOnly( s, dp, false );
+ assertTrue( dpLI.isUninitialized() );
+ Hibernate.initialize( dp );
+ assertFalse( dpLI.isUninitialized() );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyViaSessionBeforeInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ s.setReadOnly( dp, true );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, true );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testModifiableViaSessionBeforeInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, false );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyViaSessionBeforeInitByModifiableQuery() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, true );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ DataPoint dpFromQuery = ( DataPoint ) s.createQuery( "from DataPoint where id=" + dpOrig.getId() ).setReadOnly( false ).uniqueResult();
+ assertTrue( Hibernate.isInitialized( dpFromQuery ) );
+ assertSame( dp, dpFromQuery );
+ checkReadOnly( s, dp, true );
+ dp.setDescription( "changed" );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyViaSessionBeforeInitByReadOnlyQuery() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp, true );
+ DataPoint dpFromQuery = ( DataPoint ) s.createQuery( "from DataPoint where id=" + dpOrig.getId() ).setReadOnly( true ).uniqueResult();
+ assertTrue( Hibernate.isInitialized( dpFromQuery ) );
+ assertSame( dp, dpFromQuery );
+ checkReadOnly( s, dp, true );
+ dp.setDescription( "changed" );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testModifiableViaSessionBeforeInitByModifiableQuery() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ DataPoint dpFromQuery = ( DataPoint ) s.createQuery( "from DataPoint where id=" + dpOrig.getId() ).setReadOnly( false ).uniqueResult();
+ assertTrue( Hibernate.isInitialized( dpFromQuery ) );
+ assertSame( dp, dpFromQuery );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testModifiableViaSessionBeforeInitByReadOnlyQuery() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ DataPoint dpFromQuery = ( DataPoint ) s.createQuery( "from DataPoint where id=" + dpOrig.getId() ).setReadOnly( true ).uniqueResult();
+ assertTrue( Hibernate.isInitialized( dpFromQuery ) );
+ assertSame( dp, dpFromQuery );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyViaLazyInitializerBeforeInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ LazyInitializer dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ assertTrue( dpLI.isUninitialized() );
+ checkReadOnly( s, dp, false );
+ dpLI.setReadOnly( true );
+ checkReadOnly( s, dp, true );
+ dp.setDescription( "changed" );
+ assertFalse( dpLI.isUninitialized() );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, true );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testModifiableViaLazyInitializerBeforeInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ LazyInitializer dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ assertTrue( dp instanceof HibernateProxy );
+ assertTrue( dpLI.isUninitialized() );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertFalse( dpLI.isUninitialized() );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, false );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+
+ public void testReadOnlyViaLazyInitializerAfterInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ LazyInitializer dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ assertTrue( dpLI.isUninitialized() );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertFalse( dpLI.isUninitialized() );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, false );
+ dpLI.setReadOnly( true );
+ checkReadOnly( s, dp, true );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testModifiableViaLazyInitializerAfterInit() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ LazyInitializer dpLI = ( ( HibernateProxy ) dp ).getHibernateLazyInitializer();
+ assertTrue( dpLI.isUninitialized() );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertFalse( dpLI.isUninitialized() );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, false );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testModifyToReadOnlyToModifiableIsUpdatedFailureExpected() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ));
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp,true );
+ s.setReadOnly( dp, false );
+ checkReadOnly( s, dp, false );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ try {
+ assertEquals( "changed", dp.getDescription() );
+ // should fail due to HHH-4642
+ }
+ finally {
+ s.getTransaction().rollback();
+ s.close();
+ s = openSession();
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ public void testReadOnlyModifiedToModifiableIsUpdatedFailureExpected() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ));
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp,true );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ s.setReadOnly( dp, false );
+ checkReadOnly( s, dp, false );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ try {
+ assertEquals( "changed", dp.getDescription() );
+ // should fail due to HHH-4642
+ }
+ finally {
+ s.getTransaction().rollback();
+ s.close();
+ s = openSession();
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ public void testReadOnlyChangedEvictedUpdate() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ));
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp,true );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ s.evict( dp );
+ assertFalse( s.contains( dp ) );
+ s.update( dp );
+ checkReadOnly( s, dp, false );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyToModifiableInitWhenModifiedIsUpdated() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp,true );
+ s.setReadOnly( dp, false );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ));
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyInitToModifiableModifiedIsUpdated() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp,true );
+ assertFalse( Hibernate.isInitialized( dp ));
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ));
+ checkReadOnly( s, dp,true );
+ s.setReadOnly( dp, false );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyModifiedUpdate() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp,true );
+ assertFalse( Hibernate.isInitialized( dp ));
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp,true );
+ s.update( dp );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyDelete() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp,true );
+ assertFalse( Hibernate.isInitialized( dp ));
+ s.delete( dp );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertNull( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyProxyMergeDetachedProxyWithChange() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ));
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ s.getTransaction().commit();
+ s.close();
+
+ // modify detached proxy
+ dp.setDescription( "changed" );
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dpLoaded = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dpLoaded instanceof HibernateProxy );
+ checkReadOnly( s, dpLoaded, false );
+ s.setReadOnly( dpLoaded, true );
+ checkReadOnly( s, dpLoaded,true );
+ assertFalse( Hibernate.isInitialized( dpLoaded ) );
+ DataPoint dpMerged = ( DataPoint ) s.merge( dp );
+ assertSame( dpLoaded, dpMerged );
+ assertTrue( Hibernate.isInitialized( dpLoaded ) );
+ assertEquals( "changed", dpLoaded.getDescription() );
+ checkReadOnly( s, dpLoaded, true );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyProxyInitMergeDetachedProxyWithChange() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ));
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ s.getTransaction().commit();
+ s.close();
+
+ // modify detached proxy
+ dp.setDescription( "changed" );
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dpLoaded = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dpLoaded instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dpLoaded ) );
+ Hibernate.initialize( dpLoaded );
+ assertTrue( Hibernate.isInitialized( dpLoaded ) );
+ checkReadOnly( s, dpLoaded, false );
+ s.setReadOnly( dpLoaded, true );
+ checkReadOnly( s, dpLoaded,true );
+ DataPoint dpMerged = ( DataPoint ) s.merge( dp );
+ assertSame( dpLoaded, dpMerged );
+ assertEquals( "changed", dpLoaded.getDescription() );
+ checkReadOnly( s, dpLoaded, true );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyProxyMergeDetachedEntityWithChange() {
+
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ));
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ s.getTransaction().commit();
+ s.close();
+
+ // modify detached proxy target
+ DataPoint dpEntity = ( DataPoint ) ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getImplementation();
+ dpEntity.setDescription( "changed" );
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dpLoaded = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dpLoaded instanceof HibernateProxy );
+ checkReadOnly( s, dpLoaded, false );
+ s.setReadOnly( dpLoaded, true );
+ checkReadOnly( s, dpLoaded,true );
+ assertFalse( Hibernate.isInitialized( dpLoaded ) );
+ DataPoint dpMerged = ( DataPoint ) s.merge( dpEntity );
+ assertSame( dpLoaded, dpMerged );
+ assertTrue( Hibernate.isInitialized( dpLoaded ) );
+ assertEquals( "changed", dpLoaded.getDescription() );
+ checkReadOnly( s, dpLoaded, true );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyProxyInitMergeDetachedEntityWithChange() {
+
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ));
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ s.getTransaction().commit();
+ s.close();
+
+ // modify detached proxy target
+ DataPoint dpEntity = ( DataPoint ) ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getImplementation();
+ dpEntity.setDescription( "changed" );
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dpLoaded = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dpLoaded instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dpLoaded ) );
+ Hibernate.initialize( dpLoaded );
+ assertTrue( Hibernate.isInitialized( dpLoaded ) );
+ checkReadOnly( s, dpLoaded, false );
+ s.setReadOnly( dpLoaded, true );
+ checkReadOnly( s, dpLoaded,true );
+ DataPoint dpMerged = ( DataPoint ) s.merge( dpEntity );
+ assertSame( dpLoaded, dpMerged );
+ assertEquals( "changed", dpLoaded.getDescription() );
+ checkReadOnly( s, dpLoaded, true );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testReadOnlyEntityMergeDetachedProxyWithChange() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ checkReadOnly( s, dp, false );
+ assertFalse( Hibernate.isInitialized( dp ));
+ Hibernate.initialize( dp );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ s.getTransaction().commit();
+ s.close();
+
+ // modify detached proxy
+ dp.setDescription( "changed" );
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
+ DataPoint dpEntity = ( DataPoint ) s.get( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertFalse( dpEntity instanceof HibernateProxy );
+ assertFalse( s.isReadOnly( dpEntity ) );
+ s.setReadOnly( dpEntity, true );
+ assertTrue( s.isReadOnly( dpEntity ) );
+ DataPoint dpMerged = ( DataPoint ) s.merge( dp );
+ assertSame( dpEntity, dpMerged );
+ assertEquals( "changed", dpEntity.getDescription() );
+ assertTrue( s.isReadOnly( dpEntity ) );
+ s.flush();
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testSetReadOnlyInTwoTransactionsSameSession() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp, true );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+
+ checkReadOnly( s, dp, true );
+
+ s.beginTransaction();
+ checkReadOnly( s, dp, true );
+ dp.setDescription( "changed again" );
+ assertEquals( "changed again", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testSetReadOnlyBetweenTwoTransactionsSameSession() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, false );
+ s.flush();
+ s.getTransaction().commit();
+
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp, true );
+
+ s.beginTransaction();
+ checkReadOnly( s, dp, true );
+ dp.setDescription( "changed again" );
+ assertEquals( "changed again", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testSetModifiableBetweenTwoTransactionsSameSession() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.setReadOnly( dp, true );
+ checkReadOnly( s, dp, true );
+ dp.setDescription( "changed" );
+ assertTrue( Hibernate.isInitialized( dp ) );
+ assertEquals( "changed", dp.getDescription() );
+ checkReadOnly( s, dp, true );
+ s.flush();
+ s.getTransaction().commit();
+
+ checkReadOnly( s, dp, true );
+ s.setReadOnly( dp, false );
+ checkReadOnly( s, dp, false );
+
+ s.beginTransaction();
+ checkReadOnly( s, dp, false );
+ assertEquals( "changed", dp.getDescription() );
+ s.refresh( dp );
+ assertEquals( dpOrig.getDescription(), dp.getDescription() );
+ checkReadOnly( s, dp, false );
+ dp.setDescription( "changed again" );
+ assertEquals( "changed again", dp.getDescription() );
+ s.flush();
+ s.getTransaction().commit();
+
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dpOrig.getId() );
+ assertEquals( dpOrig.getId(), dp.getId() );
+ assertEquals( "changed again", dp.getDescription() );
+ assertEquals( dpOrig.getX(), dp.getX() );
+ assertEquals( dpOrig.getY(), dp.getY() );
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testIsReadOnlyAfterSessionClosed() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ s.close();
+
+ try {
+ s.isReadOnly( dp );
+ fail( "should have failed because session was closed" );
+ }
+ catch ( SessionException ex) {
+ // expected
+ }
+ finally {
+ s = openSession();
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ public void testIsReadOnlyAfterSessionClosedViaLazyInitializer() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ assertTrue( s.contains( dp ) );
+ s.close();
+
+ assertNull( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getSession() );
+ try {
+ ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().isReadOnly();
+ fail( "should have failed because session was detached" );
+ }
+ catch ( TransientObjectException ex) {
+ // expected
+ }
+ finally {
+ s = openSession();
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+
+ public void testDetachedIsReadOnlyAfterEvictViaSession() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ assertTrue( s.contains( dp ) );
+ s.evict( dp );
+ assertFalse( s.contains( dp ) );
+ assertNull( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getSession() );
+
+ try {
+ s.isReadOnly( dp );
+ fail( "should have failed because proxy was detached" );
+ }
+ catch ( TransientObjectException ex) {
+ // expected
+ }
+ finally {
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ public void testDetachedIsReadOnlyAfterEvictViaLazyInitializer() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.evict( dp );
+ assertFalse( s.contains( dp ) );
+ assertNull( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getSession() );
+ try {
+ ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().isReadOnly();
+ fail( "should have failed because proxy was detached" );
+ }
+ catch ( TransientObjectException ex) {
+ // expected
+ }
+ finally {
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ public void testSetReadOnlyAfterSessionClosed() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ s.close();
+
+ try {
+ s.setReadOnly( dp, true );
+ fail( "should have failed because session was closed" );
+ }
+ catch ( SessionException ex) {
+ // expected
+ }
+ finally {
+ s = openSession();
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ public void testSetReadOnlyAfterSessionClosedViaLazyInitializer() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.getTransaction().commit();
+ assertTrue( s.contains( dp ) );
+ s.close();
+
+ assertNull( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getSession() );
+ try {
+ ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().setReadOnly( true );
+ fail( "should have failed because session was detached" );
+ }
+ catch ( TransientObjectException ex) {
+ // expected
+ }
+ finally {
+ s = openSession();
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+
+ public void testDetachedSetReadOnlyAfterEvictViaSession() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ assertTrue( s.contains( dp ) );
+ s.evict( dp );
+ assertFalse( s.contains( dp ) );
+ assertNull( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getSession() );
+
+ try {
+ s.setReadOnly( dp, true );
+ fail( "should have failed because proxy was detached" );
+ }
+ catch ( TransientObjectException ex) {
+ // expected
+ }
+ finally {
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ public void testDetachedSetReadOnlyAfterEvictViaLazyInitializer() {
+ DataPoint dpOrig = createDataPoint( CacheMode.IGNORE );
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+
+ s.beginTransaction();
+ DataPoint dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpOrig.getId() ) );
+ assertTrue( dp instanceof HibernateProxy );
+ assertFalse( Hibernate.isInitialized( dp ) );
+ checkReadOnly( s, dp, false );
+ s.evict( dp );
+ assertFalse( s.contains( dp ) );
+ assertNull( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getSession() );
+ try {
+ ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().setReadOnly( true );
+ fail( "should have failed because proxy was detached" );
+ }
+ catch ( TransientObjectException ex) {
+ // expected
+ }
+ finally {
+ s.beginTransaction();
+ s.delete( dp );
+ s.getTransaction().commit();
+ s.close();
+ }
+ }
+
+ private DataPoint createDataPoint(CacheMode cacheMode) {
+ Session s = openSession();
+ s.setCacheMode( cacheMode );
+ s.beginTransaction();
+ DataPoint dp = new DataPoint();
+ dp.setX( new BigDecimal( 0.1d ).setScale(19, BigDecimal.ROUND_DOWN) );
+ dp.setY( new BigDecimal( Math.cos( dp.getX().doubleValue() ) ).setScale(19, BigDecimal.ROUND_DOWN) );
+ dp.setDescription( "original" );
+ s.save( dp );
+ s.getTransaction().commit();
+ s.close();
+ return dp;
+ }
+
+ private void checkReadOnly(Session s, Object proxy, boolean expectedReadOnly) {
+ assertTrue( proxy instanceof HibernateProxy );
+ LazyInitializer li = ( ( HibernateProxy ) proxy ).getHibernateLazyInitializer();
+ assertSame( s, li.getSession() );
+ assertEquals( expectedReadOnly, s.isReadOnly( proxy ) );
+ assertEquals( expectedReadOnly, li.isReadOnly() );
+ assertEquals( Hibernate.isInitialized( proxy ), ! li.isUninitialized() );
+ if ( Hibernate.isInitialized( proxy ) ) {
+ assertEquals( expectedReadOnly, s.isReadOnly( li.getImplementation() ) );
+ }
+ }
+}
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java 2010-01-12 21:00:11 UTC (rev 18524)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java 2010-01-13 01:04:55 UTC (rev 18525)
@@ -67,7 +67,7 @@
return new FunctionalTestClassTestSuite( ReadOnlyTest.class );
}
- public void testReadOnlyOnProxiesFailureExpected() {
+ public void testReadOnlyOnProxies() {
Session s = openSession();
s.setCacheMode( CacheMode.IGNORE );
s.beginTransaction();
@@ -82,6 +82,7 @@
s = openSession();
s.setCacheMode(CacheMode.IGNORE);
+ s.beginTransaction();
dp = ( DataPoint ) s.load( DataPoint.class, new Long( dpId ) );
assertFalse( "was initialized", Hibernate.isInitialized( dp ) );
s.setReadOnly( dp, true );
@@ -178,6 +179,138 @@
}
+ public void testReadOnlyDelete() {
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ Transaction t = s.beginTransaction();
+ DataPoint dp = new DataPoint();
+ dp.setX( new BigDecimal(0.1d).setScale(19, BigDecimal.ROUND_DOWN) );
+ dp.setY( new BigDecimal( Math.cos( dp.getX().doubleValue() ) ).setScale(19, BigDecimal.ROUND_DOWN) );
+ s.save(dp);
+ t.commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ t = s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dp.getId() );
+ s.setReadOnly( dp, true );
+ s.delete( dp );
+ t.commit();
+ s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ List list = s.createQuery("from DataPoint where description='done!'").list();
+ assertTrue( list.isEmpty() );
+ t.commit();
+ s.close();
+
+ }
+
+ public void testReadOnlyModeWithExistingModifiableEntity() {
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ Transaction t = s.beginTransaction();
+ DataPoint dp = null;
+ for ( int i=0; i<100; i++ ) {
+ dp = new DataPoint();
+ dp.setX( new BigDecimal(i * 0.1d).setScale(19, BigDecimal.ROUND_DOWN) );
+ dp.setY( new BigDecimal( Math.cos( dp.getX().doubleValue() ) ).setScale(19, BigDecimal.ROUND_DOWN) );
+ s.save(dp);
+ }
+ t.commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ t = s.beginTransaction();
+ DataPoint dpLast = ( DataPoint ) s.get( DataPoint.class, dp.getId() );
+ assertFalse( s.isReadOnly( dpLast ) );
+ int i = 0;
+ ScrollableResults sr = s.createQuery("from DataPoint dp order by dp.x asc")
+ .setReadOnly(true)
+ .scroll(ScrollMode.FORWARD_ONLY);
+ int nExpectedChanges = 0;
+ while ( sr.next() ) {
+ dp = (DataPoint) sr.get(0);
+ if ( dp.getId() == dpLast.getId() ) {
+ //dpLast existed in the session before executing the read-only query
+ assertFalse( s.isReadOnly( dp ) );
+ }
+ else {
+ assertTrue( s.isReadOnly( dp ) );
+ }
+ if (++i==50) {
+ s.setReadOnly(dp, false);
+ nExpectedChanges = ( dp == dpLast ? 1 : 2 );
+ }
+ dp.setDescription("done!");
+ }
+ t.commit();
+ s.clear();
+ t = s.beginTransaction();
+ List list = s.createQuery("from DataPoint where description='done!'").list();
+ assertEquals( list.size(), nExpectedChanges );
+ s.createQuery("delete from DataPoint").executeUpdate();
+ t.commit();
+ s.close();
+ }
+
+ public void testModifiableModeWithExistingReadOnlyEntity() {
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ Transaction t = s.beginTransaction();
+ DataPoint dp = null;
+ for ( int i=0; i<100; i++ ) {
+ dp = new DataPoint();
+ dp.setX( new BigDecimal(i * 0.1d).setScale(19, BigDecimal.ROUND_DOWN) );
+ dp.setY( new BigDecimal( Math.cos( dp.getX().doubleValue() ) ).setScale(19, BigDecimal.ROUND_DOWN) );
+ s.save(dp);
+ }
+ t.commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ t = s.beginTransaction();
+ DataPoint dpLast = ( DataPoint ) s.get( DataPoint.class, dp.getId() );
+ assertFalse( s.isReadOnly( dpLast ) );
+ s.setReadOnly( dpLast, true );
+ assertTrue( s.isReadOnly( dpLast ) );
+ int i = 0;
+ ScrollableResults sr = s.createQuery("from DataPoint dp order by dp.x asc")
+ .setReadOnly(false)
+ .scroll(ScrollMode.FORWARD_ONLY);
+ int nExpectedChanges = 0;
+ while ( sr.next() ) {
+ dp = (DataPoint) sr.get(0);
+ if ( dp.getId() == dpLast.getId() ) {
+ //dpLast existed in the session before executing the read-only query
+ assertTrue( s.isReadOnly( dp ) );
+ }
+ else {
+ assertFalse( s.isReadOnly( dp ) );
+ }
+ if (++i==50) {
+ s.setReadOnly(dp, true);
+ nExpectedChanges = ( dp == dpLast ? 99 : 98 );
+ }
+ dp.setDescription("done!");
+ }
+ t.commit();
+ s.clear();
+ t = s.beginTransaction();
+ List list = s.createQuery("from DataPoint where description='done!'").list();
+ assertEquals( list.size(), nExpectedChanges );
+ s.createQuery("delete from DataPoint").executeUpdate();
+ t.commit();
+ s.close();
+ }
+
public void testReadOnlyOnTextType() {
final String origText = "some huge text string";
final String newText = "some even bigger text string";
14 years, 4 months
Hibernate SVN: r18524 - in core/trunk: entitymanager and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-01-12 16:00:11 -0500 (Tue, 12 Jan 2010)
New Revision: 18524
Removed:
core/trunk/annotations/changelog.txt
core/trunk/entitymanager/changelog.txt
Log:
HHH-4783
Deleted: core/trunk/annotations/changelog.txt
===================================================================
--- core/trunk/annotations/changelog.txt 2010-01-12 20:19:32 UTC (rev 18523)
+++ core/trunk/annotations/changelog.txt 2010-01-12 21:00:11 UTC (rev 18524)
@@ -1,736 +0,0 @@
-Hibernate Annotations Changelog
-===============================
-
-3.4.0.GA (20-08-2008)
-----------------------
-
-** Bug
- * [ANN-761] - Typo in documentation
-
-
-** Improvement
- * [ANN-765] - Update of "Preface" section in documentation
- * [ANN-766] - Test updates due to the usage of (oracle) reserved keywords as properties
-
-
-
-** Task
- * [ANN-767] - Refactor build to allow filtering of resources
-
-
-3.4.0.CR2 (01-08-2008)
-----------------------
-
-** Bug
- * [ANN-716] - Join table name cannot be resolved when using custom EJB3NamingStrategy
- * [ANN-718] - @JoinTable / @JoinColumn fails when using backticks in PK field name
- * [ANN-722] - ANN-694 alive: FK circularity error under certain circumstances
- * [ANN-723] - Impossible to bind a SortedMap collection
- * [ANN-730] - Still incorrect FK circularity errors
- * [ANN-742] - Primary key should not be set on nullable column
- * [ANN-748] - @JoinColumn overrides scale and percision in ManyToOne map..
- * [ANN-750] - @NaturalId not working when placed on single *ToOne property
-
-
-** Improvement
- * [ANN-625] - @OrderBy usage on a joined classes (when using join table) produces incorred SQL syntax.
- * [ANN-733] - @Immutable documentation improvement
- * [ANN-744] - Enumerated Primary Key
-
-
-3.4.0.CR1 (27-05-2008)
-----------------------
-
-** Improvement
- * [ANN-741] - Move to slf4j
-
-** New Feature
- * [ANN-713] - Use an ant task to deploy the maven artifacts
- * [ANN-736] - Add pom
- * [ANN-737] - Make build independent of Hibernate Core structure
- * [ANN-738] - Move to Hibernate Core 3.3
-
-
-3.3.1.GA (14-03-2008)
----------------------
-
-** Bug
- * [ANN-610] - Copy/paste errors in reference docs
- * [ANN-694] - Incorrect report of FK circularity error when the @*ToOne property name starts with the identifier property name
- * [ANN-696] - @Type with Maps from Element to Element applies to both key to value type.
-
-
-** Improvement
- * [ANN-701] - Better error message on incorrect use of @CollectionId
-
-** New Feature
- * [ANN-607] - Release the hibernate-commons-annotations source at Sourceforce
- * [ANN-709] - Express @Type on a Map key
-
-** Patch
- * [ANN-706] - Typo's in reference manuals
-
-
-3.3.1.CR1 (06-03-2008)
-----------------------
-
-** Bug
- * [ANN-509] - referencedColumnName to non primary key foreign key column causes MappingException
- * [ANN-590] - Alphabetical order issue when @ManyToOne is used in PrimaryKey and explicit referencedColumnName are used
- * [ANN-653] - Exception when overriding collection mapping with @AssociationOverride
- * [ANN-673] - Guaranty column order in genereted schema
- * [ANN-676] - Composite PK/FK and the alphabetical order of class names
- * [ANN-683] - AnnotationConfiguration hashCode collisions produce random binding failures
- * [ANN-698] - Unbound property when default field access is used lead to unbound AnnotationException
- * [ANN-699] - AnnotationBinder.mustBeSkipped references org.hibernate.tool.instrument.javassist.FieldHandler (hardcoded String-Reference)
- * [ANN-700] - Hibernate's @NamedQuery always sets flushMode
-
-
-** Improvement
- * [ANN-650] - Explicitly disallow @Version on @Embedded and throw meaningful Exception
- * [ANN-690] - Override relevant Configuration methods in AnnotationConfiguration for method chaining
-
-** New Feature
- * [ANN-442] - Support @GenericGenerators (Paul Cowan)
- * [ANN-695] - Transparent integration of the new Hibernate Search collection event listeners
-
-
-3.3.1.Beta1 (31-10-2007)
-------------------------
-
-** Bug
- * [ANN-434] - Confusing error message with @EmbeddedId and @Id
- * [ANN-602] - SecondaryTable with EmbeddedId or IdClass containing @ManyToOne fail
- * [ANN-608] - NullPointerException from AnnotationConfiguration with specific order of calling addResource and addPackage when package-info.java present
- * [ANN-613] - NPE when mappedBy property is wrong on a @OneToOne
- * [ANN-616] - Mistakes in 2.4.6.2.3 of Manual
- * [ANN-617] - NullPointerException when handling @OrderBy
- * [ANN-618] - @AccessType("propery") cannot be overriden by @AccessType("field")
- * [ANN-619] - @OneToOne in primary key fails
- * [ANN-621] - Unable to handle JOINED stragegy when the root entity id contains a @ManyToOne
- * [ANN-631] - Mistake in "2.2.5.2. Many-to-one"
- * [ANN-634] - @CollectionOfElements cannot be combined with @Filter (or @Where) and EAGER fetching
- * [ANN-637] - @o.h.a.Table.indexes returns obscur message when the table does not exist
- * [ANN-643] - Missing .configure() on session factory creation examples
- * [ANN-647] - @Where JavaDoc does not specify that it describes a SQL fragment
- * [ANN-648] - o.h.a.Table.comment and o.h.a.Table.indexes fail on secondary tables
-
-
-** Improvement
- * [ANN-605] - docs say @Enumerated(STRING), should be @Enumerated(EnumType.STRING)
- * [ANN-606] - @Immutable does not throw error or warning on usage on subclass
- * [ANN-633] - JAR file should contain vendor- and versioning information
- * [ANN-671] - Log "Validator not present" only once
-
-** New Feature
- * [ANN-28] - @Any
- * [ANN-122] - Add @NaturalId annotation (Nicol�s Lichtmaier)
-
-** Patch
- * [ANN-575] - Mistakes in "2.2.5.1. One-to-one"
- * [ANN-576] - Mistake in "2.2.5.2. Many-to-one"
- * [ANN-577] - Improvement in "2.2.5.3.2.3. Unidirectional with join table"
- * [ANN-578] - Improvement in "2.2.5.3.3.1. Definition"
- * [ANN-579] - Mistake in "2.2.5.3.3.1. Definition"
- * [ANN-580] - Mistake in "2.2.2.3. Embedded objects (aka components)"
- * [ANN-581] - Improvement in "2.4.8. Filters"
- * [ANN-588] - ProxyBreakingTest fails on case sensitive file systems
- * [ANN-595] - Remove FlushModeType.NEVER
-
-
-3.3.0.GA (19-03-2007)
----------------------
-
-** Bug
- * [ANN-515] - Fields are not correctly quoted in @OneToMany relationships when specified
- * [ANN-516] - @OrderBy added to wrong table in inheritance relationship
- * [ANN-517] - Default NodeName value not set in HAN leading to NPE in DOM4J mode (Daniel)
- * [ANN-521] - package-list file is missing from javax.persistence documentation
- * [ANN-531] - EntityMode.DOM4J does not deserialize collection entities
- * [ANN-544] - @SqlDeleteAll wrt to Collections
- * [ANN-547] - Typo in Docs: 2.2.2.2 Declaring Column Attributes
- * [ANN-549] - key column of a true map should be not null when a join table is used
- * [ANN-551] - Guaranty the same parameter ordering when overriding SQL across VMs and compilations (S�ren Pedersen)
- * [ANN-554] - NPE with @Id on @OneToOne
- * [ANN-555] - Fix typo @Tables.values to @Table.value
- * [ANN-556] - @OneToOne(mappedBy might fail depending on alphebetical order
- * [ANN-559] - Undefined filter definition leads to NPE rather than a proper exception
- * [ANN-560] - Quoting clashes with defaults in NamingStrategy
- * [ANN-567] - Ability to specify a custom persister on a collection (Shawn Clowater)
- * [ANN-570] - @DiscriminatorForumla typo
- * [ANN-574] - CascadeType ALL is not equals to REMOVE+REFRESH+PERSIST+MERGE
-
-
-** Improvement
- * [ANN-26] - @OptimisticLock(excluded=true) (Logi Ragnarsson)
- * [ANN-104] - Allow SQL customization for CRUD on secondary tables
- * [ANN-252] - AnnotationConfiguration silently ignores classes that are annotated with wrong Entity, or not annotated.
- * [ANN-444] - Ability to define fetch mode, inverse and optional for a Secondary table
- * [ANN-492] - IdClass of a composite id + ManyToOne associations in id = Repeated column error (testcase patch)
- * [ANN-502] - Cannot fully disable integration with Hibernate Validator
- * [ANN-525] - @ForeignKey for secondary tables and joined subclasses
- * [ANN-529] - MapBinder can generate SQL statements not supported by Oracle 10g
- * [ANN-532] - Better exception when @UniqueConstraint refers to a wrong column name
- * [ANN-535] - Force property insertability/updatability when @Generated is used
- * [ANN-542] - @Immutable for entities and collections
- * [ANN-553] - Remove classpath dependency between Hibernate Annotations and Hibernate Validator
-
-** New Feature
- * [ANN-103] - Allow to specify fetching strategy for secondary table
- * [ANN-505] - Support @Tuplizer
- * [ANN-552] - Transparent event integration for Search and Validator
-
-
-** Task
- * [ANN-584] - Move Validator and Search to their own project
-
-
-3.2.1.GA (8-12-2006)
---------------------
-
-** Bug
- * [ANN-395] - @Embedded can not map interface
- * [ANN-425] - Property not found when defined in a @IdClass and referenced by a @OneToMany
- * [ANN-430] - @ManyToOne results in default outer join eager fetch, should be lazy
- * [ANN-448] - @OrderBy does not work with an association table when Set is used for collection
- * [ANN-450] - @MapKey does not work with embedded fields
- * [ANN-452] - Check lucene behavior on rollback()
- * [ANN-458] - Hibernate Validator initialization always requires keys in ValidatorMessges.properties
- * [ANN-466] - Discriminator values longer than 31 break in PostgreSQL
- * [ANN-471] - lazily resolve default messages in DefaultMessageInterpolator
- * [ANN-473] - Unable to define unique constraints on a denormalized table (union-subclass)
- * [ANN-474] - <sequence-generator> and <table-generator> at the entity level can override those at the property level in JPA XML
- * [ANN-477] - @Formula doesn't work in entities referenced by @JoinColumn(referencedColumnName="...")
- * [ANN-491] - Collection mapped with javax.persistence.MapKey isn't loaded properly.
- * [ANN-499] - @IdClass and @ManyToOne leads to repeated column exception
-
-
-** Improvement
- * [ANN-37] - Support for SQL Overriding (L�szl� Benke, Assaf Berg)
- * [ANN-387] - lucene integration does not support Inheritance
- * [ANN-422] - Add targetEntity to MapKeyManyToMany annotation
- * [ANN-449] - @Min, @Max store value as Integer. @Range stores values as Long.
- * [ANN-456] - ClassValidator sould be able to get a reflectionManager from the caller (ie the event listener)
- * [ANN-460] - Support for several entity types per Index
- * [ANN-468] - IdFieldBridge should be introduced to cope with additional constraints on Brigdes used by document ids
- * [ANN-475] - Make ClassValidator independent from javax.persistence annotations
- * [ANN-476] - EJB3 naming strategy struggles with quoted identifiers when generating composed table/column names
- * [ANN-497] - Reuse the same synchronization queue per transaction for Search operations
-
-** New Feature
- * [ANN-363] - Support for a @FieldBridge
- * [ANN-364] - @Boost or equivalent on entity and on fields
- * [ANN-383] - Align with Lucene 2 APIs for annotations
- * [ANN-384] - Reindex an object on a per instance basis (not triggered by a change)
- * [ANN-454] - Support for Built-in bridges in Lucene
- * [ANN-455] - Comprehensive built-in type support
- * [ANN-457] - Support field annotations in Hibernate Lucene (Richard Hallier)
- * [ANN-463] - @DateBridge
- * [ANN-478] - French translation (Vincent Ricard)
- * [ANN-482] - Use of transaction Synchronization rather than post-commit-* events
- * [ANN-493] - @NonEmpty
-
-** Patch
- * [ANN-445] - Add dutch (Nederlands) validator_nl.properties for hibernate validator
- * [ANN-465] - SingleTableTest.testDefaultDiscriminatorColumn fix
- * [ANN-498] - Add Spanish Validation Bundle
- * [ANN-500] - Swedish default messages
-
-** Task
- * [ANN-479] - Various optimizations of the Xlayer (reflection layer)
- * [ANN-483] - reorganize lucene packaging
- * [ANN-488] - Rename org.hibernate.lucene to org.hibernate.search
-
-
-3.2.0.GA (16-10-2006)
----------------------
-Same code base as 3.2.0.CR3
-
-** Task
- * [ANN-459] - Add EJB 3.0 JavaDoc to the distribution
-
-
-3.2.0.CR3 (04-10-2006)
-----------------------
-** Bug
- * [ANN-408] - map a entity to integer map is not possible
-
-
-** Improvement
- * [ANN-346] - Introduce @FilterJoinTable to complete @Filter on association involving a join table
- * [ANN-447] - Introduce @WhereJoinTable to complete @Where on association involving a join table
-
-** New Feature
- * [ANN-443] - Define a hibernate.validator.interpolator_class
-
-
-3.2.0.CR2 (16-09-2006)
-----------------------
-** Bug
- * [ANN-181] - Do not fail on unbound attributes marked as @Type
- * [ANN-243] - @MapKey doesn't properly refer to column name mapped to property (quoted column)
- * [ANN-345] - EJB3NamingStrategy should be Serializable
- * [ANN-359] - @MappedSuperclass overriding fails on EJB3 DD
- * [ANN-362] - Specification of table @Table name with quotes using backticks fails with @OneToMany mapping
- * [ANN-368] - Keywords first letter is not decapilalized
- * [ANN-369] - @CollectionOfElements on a Map uses reserved word "key" as column name
- * [ANN-370] - Lucene updates are not thread safe
- * [ANN-375] - @Email validator failed a valid email address
- * [ANN-379] - Map<Entity, Entity> fails due to unique constraint on map-key column
- * [ANN-382] - Id involving many to one may fail depending on the entity process ordering
- * [ANN-393] - Documentation errors in Many-toMany Annotation explanation
- * [ANN-405] - JPA XML overriding wrong when default schema and *-to-one association
- * [ANN-409] - Enum constants in HQL leads to ClassCastException
- * [ANN-411] - @Generated(INSERT) properties does not update columns
- * [ANN-412] - Generator definition (@Table, @Generic, @Sequence) no longer taken into account at field level
- * [ANN-414] - Map, OneToMany, join table or @ManyToMany does not work on MySQL and on composite keys
- * [ANN-415] - <named-native-query result-class leads to CCE
- * [ANN-416] - Mapping of inheritance with several generic superclasses fails
- * [ANN-421] - Unable to map no packaged classes when JPA XML is used
- * [ANN-423] - @Min/@Max broken with BigInteger/BigDecimal
- * [ANN-424] - column overriding fails on composite elements when defined at the entity level
- * [ANN-426] - Validator keep a JavaXFactory in a static variable creating memleaks on redeployement
- * [ANN-427] - throw "java.lang.IllegalStateException: Property parent has an unbound type and no explicit target entity." on generic type
-
-
-** Improvement
- * [ANN-7] - Document usage of @IndexColumn in one-to-many with indexed collection
- * [ANN-36] - @ForceDiscriminator (Serg Prasolov)
- * [ANN-39] - @CollectionId for idbags
- * [ANN-47] - Allow to set an enum parameter on a query
- * [ANN-261] - Allow specifying foreign key constraint name using annotations (inspired by David Hay)
- * [ANN-265] - Fall back to default validator message if the key is not found
- * [ANN-343] - validator messages in brazilian portuguese
- * [ANN-350] - Support ejb3 dd when no schema locator is defined
- * [ANN-351] - Validator Brazilian translation
- * [ANN-355] - Make XML overriding rules for access type smoother
- * [ANN-356] - Clear the PC on Rollback on RESOURCE_LOCAL Transactions
- * [ANN-371] - Abstract DocumentBuilder from the underlying Directory implementation
- * [ANN-373] - imports are not done for the full entityname
- * [ANN-374] - Map - OneToMany w or w/o join table creates bad sql
- * [ANN-381] - Make possible to specify an @EmbeddedId's field in a @OneToMany's mappedBy property
- * [ANN-397] - Incomplete AnnotationException at org.hibernate.cfg.annotations.TableBinder
- * [ANN-399] - Class validator should not WARN on unbound properties not involved in validation
-
-** New Feature
- * [ANN-284] - @OrderBy clash with @Formula Properties
- * [ANN-349] - Add @FlushModeType.MANUAL
- * [ANN-367] - Upgrade to Lucene 2.0.0 (Sylvain Vieujot)
- * [ANN-372] - @Boost factor on document and fields
- * [ANN-378] - Chinese translation (Xiaogang Cao)
- * [ANN-385] - Abstract the Lucene directory implementation and allow configuration based definition
- * [ANN-386] - Add support for RAMDirectory
- * [ANN-419] - Support SortedMap
- * [ANN-440] - MessageIntrospector hook introduced in HibernateValidator
-
-
-** Task
- * [ANN-410] - Depreciate EJB 3 Package annotations
-
-
-3.2.0.CR1 (13-05-2006)
-----------------------
-** Bug
- * [ANN-95] - Cannot create a unique constraint on columns belonging to both the superclass and the class
- * [ANN-97] - JoinColumn with referencedColumnName clashes with unique=true on target column
- * [ANN-118] - Duplicate unique constraint may be created
- * [ANN-281] - @Mapkey broken if key is Entity
- * [ANN-288] - Hibernate chokes on methods in entities starting with get...() and returning int[]
- * [ANN-289] - @OneToOne and @Column fails
- * [ANN-305] - ImprovedNamingStrategy not compatible with Hibernate annotations (@Index in particular)
- * [ANN-306] - "Unbound" @Transient properties not properly being ignored
- * [ANN-307] - BindHelper.findPropertiesByColumns behaviour is non deterministic due to HashSet being used
- * [ANN-310] - Dist is missing resource files
- * [ANN-329] - Entity.name is ignored in inheritance mapping
- * [ANN-330] - Entity name not used to build default table name (classname is used instead)
- * [ANN-331] - Extra element concatenated to default columns in collection of elements
- * [ANN-333] - CollectionOfElements not using specified JoinTable
- * [ANN-335] - AnnotationBinder just throws NPE if @OneToMany annotation is not on a Collection or Array
- * [ANN-339] - @OrderBy does not work when an association table is involved
- * [ANN-340] - Hard dependency to CGLIB classes in mustBeSkipped()
-
-
-** Improvement
- * [ANN-120] - Map, OneToMany, join table or @ManyToMany does not work
- * [ANN-195] - Potentially move from TableA_TableB to EntityA_EntityB on join tables is the spec remains
- * [ANN-293] - Unidirectional @ManyToMany should throw and error or warning when target entity cannot be resolved
- * [ANN-323] - XML overriding should have precedence over annotations for queries, rs, generators
- * [ANN-325] - entity described in XML should be part of the mapped entities
- * [ANN-327] - Support for Map<Entity,Entity>
- * [ANN-337] - XML result-set-mapping should overrides @SqlResultSetMapping
- * [ANN-338] - @Temporal no longer has default value
-
-** New Feature
- * [ANN-40] - @Parent
- * [ANN-89] - Support generated=true property option for automatic refresh
- * [ANN-158] - Support for @ManyToOne or @OneToOne @JoinTable (bidirectional)
- * [ANN-224] - Ability to override fetching and lazy options through annotations
- * [ANN-276] - Proper support of @OneToOne @PrimaryKeyJoinColumns
-
-
-3.1.0.Beta10b Preview (27-04-2006)
-----------------------------------
-** Bug
- * [ANN-292] - @EmbeddedId object containing only @ManyToOne fails / wrong pk generation when@EmbeddedId contains @ManyToOne
- * [ANN-295] - Generators behave like allocationSize+1
- * [ANN-300] - @OneToOne(optional=false) does not create foreign key
- * [ANN-301] - Validator won't validate "new" (=transient) bean when bean is CGLIB-instrumented
- * [ANN-319] - Make Hibernate Annotations types Serializable and thread safe
- * [ANN-321] - Discriminator column wo @DiscriminatorColumn has the wrong varchar length
- * [ANN-328] - @javax.persistence.MapKey broken
-
-
-** Improvement
- * [ANN-316] - Do not escape el expressions like #{foo} expressions in Validation messages
-
-** New Feature
- * [ANN-1] - Support Map
- * [ANN-296] - Support for allocationSize in @SequenceGenerator
- * [ANN-304] - Display the version number at init time to avoid user confusion regarding the version used
- * [ANN-322] - Allow EJB3 style XML Overriding
-
-
-3.1beta9 Preview (27-03-2006)
------------------------------
-** Bug
- * [ANN-16] - Annotations: composite pk with two manytoone not working
- * [ANN-98] - Wrong unsaved-value strategy for IdClass entities
- * [ANN-196] - sequence should increase by assocationSize rather than regular hilo
- * [ANN-197] - table generator should stock hi * low_max instead of hi
- * [ANN-211] - ClassValidator throws NPE during flush
- * [ANN-230] - Id Annotation - bad example of GeneratedValue
- * [ANN-234] - @NotNull syntax doesn't make join column null in conjunction with @OneToOne or @ManyToOne
- * [ANN-236] - @OneToMany(mappedBy) cannot referenced an hbm file described entity
- * [ANN-240] - @AttributeOverride only works in @Entity, not @MappedSuperclass
- * [ANN-241] - @Index broken on property when no columnName is defined
- * [ANN-253] - Do not raise unresolved type exception if targetEntity is defined on the association annotation
- * [ANN-254] - References to invalid CascadeType.CREATE in documentation
- * [ANN-255] - Validator problem with @Valid @Embedded objects
- * [ANN-256] - Incorrect classloader used for ResourceBundle loading in JavaEE environment
- * [ANN-257] - referencedColumnName is not recognized on a many-to-one to a composite primary key
- * [ANN-258] - OneToOne annotation: Hibernate is not respecting the optional=true behaviour
- * [ANN-266] - @Temporal on Calendar is not mapped properly
- * [ANN-269] - doc error in example validation annotation
- * [ANN-274] - @AttributeOverride ignored when defined on an @Entity having a @MappedSuperclass annotated with @IdClass
- * [ANN-280] - Index not work
- * [ANN-282] - @IdClass including @Id claims no identifier property rather than @Id not authorized
-
-
-** Improvement
- * [ANN-146] - @NotNull should be ignored for SINGLE_TABLE subclass properties
- * [ANN-208] - Enable @Valid for Collections, Maps and Arrays
- * [ANN-223] - Entity name should be the default for discriminator value (not the fqcn)
- * [ANN-233] - @Email not documented
- * [ANN-245] - Better doc on MapKey explaining that the column is shared between the key and the referenced property
- * [ANN-262] - @org.hibernate.annotatios.Table.name remaned in @...Table.appliesTo
- * [ANN-271] - Change @EntityResult(Class entityClass) ( was @EntityResult(String name) )
- * [ANN-272] - Remove TYPE @Target on @JoinColumn(s)
- * [ANN-275] - Default discriminator column is DTYPE rather than TYPE
- * [ANN-291] - addUnderscore changed to protected visibility in DefaultComponentSafeNamingStrategy as an extension point
-
-** New Feature
- * [ANN-15] - Use of @ManyToOne in a @EmbeddedId
- * [ANN-226] - Allow Associations within an @Embeddable Class
- * [ANN-259] - @OnDelete for @OneToOne and @ManyToOne (Radim Tlusty, Mat?j Kraus)
- * [ANN-270] - Add @SqlResultSetMappings
- * [ANN-273] - @AssociationOverride(s) similar to @AttributeOverride(s)
- * [ANN-287] - Abstraction layer on top of reflection calls (Paolo Perrotta, Davide Marchignoli)
-
-
-** Task
- * [ANN-228] - Get rid of the compliance and limitation section in the doc.
- * [ANN-239] - DefaultValidatorMessages_de.properties: translation errors
-
-
-3.1beta8 Preview (20-01-2006)
------------------------------
-** Bug
- * [ANN-132] - transient fields are considered to be persistent when not annotated with @Transient
- * [ANN-162] - OneToMany mapping from annotated to hbm loaded class fails with infinite loop
- * [ANN-175] - extractType executed on @Transient and fail when the return type is <T extends MembershipData> T
- * [ANN-176] - Endless loop when annotated class references by ManyToOne class mapped in .hbm.xml
- * [ANN-177] - unable to use referencedColumnName = joined subclass primary column name
- * [ANN-178] - Different handling column naming with @JoinColumn between 3.1beta5 and 3.1beta7
- * [ANN-180] - Indexed collection, field access, onetomany+mappedby seems to fail
- * [ANN-187] - Unable to referenceColumnName a column (property) of the super class
- * [ANN-193] - @IdClass should work on @MappedSuperclass
- * [ANN-199] - NPE when mappedBy property is wrong on a @OneToOne
- * [ANN-214] - Annotation website documentation syntax error
-
-** New Feature
- * [ANN-147] - Allow embeddable subclasses in the middle of a class hierarchy
- * [ANN-172] - Delegates the SQL type of enum to @Enumerated
- * [ANN-188] - @Email for validator
- * [ANN-190] - @TableGenerator as per the pfd instead of @GeneratorIdTable & co
- * [ANN-191] - Non entity classes in between entity classes in the hierarchy
- * [ANN-200] - Support of @Basic, @Lob, @Enumerated, @Temporal as per the PFD
- * [ANN-209] - @Named(Native)Query(hints=...)
-
-
-** Improvement
- * [ANN-17] - Support dotted annotation when declaring resultsets
- * [ANN-56] - @AccessType: Support mixed field/property access strategies for an Entity
- * [ANN-192] - Access type guessed from position of @Id or @EmbeddedId
- * [ANN-194] - Access type guessed from owner entity for Embeddable objects
- * [ANN-198] - Better error message when @ManyToOne references an unknown entity
- * [ANN-201] - Rename @EmbeddableSuperclass into @MappedSuperclass
- * [ANN-203] - Move to @Id @GeneratedValue(strategy=AUTO, generator="blah")
- * [ANN-204] - @TableGenerator instead of @TableGenerator and @GeneratedIdTable
- * [ANN-205] - @NamedQuery(query=...) instead of @NamedQuery(queryString=...) same for @NamedNativeQuery
- * [ANN-215] - Support SqlResutSetMapping with dotted notation in arbitrary order
- * [ANN-216] - Support scalar queries through @ColumnResult
- * [ANN-218] - @SecondaryTable(PrimaryKeyJoinColumn[] pkJoinColumns) instead of @SecondaryTable(JoinColumn[] joins() )
- * [ANN-219] - @JoinTable(name, catalog, schema, uniqueConstraints) instead of @JoinTable(table=@Table())
- * [ANN-220] - @Column(table=) and @JoinColumn(table=) instead of @Column(secondaryTable=)
- * [ANN-221] - @Inheritance(strategy), @DiscriminatorColumn(discriminatorType), @DiscriminatorValue instead of @Inheritance
- * [ANN-225] - @EntityListeners replace @EntityListener
-
-
-3.1beta7 Preview (13-12-2005)
------------------------------
-
-** Bug
- * [ANN-114] - NPE when SecondaryTable uses a non pk reference column in @JoinColumn
- * [ANN-115] - @Index does not work on joincolumns
- * [ANN-117] - setOrphanDelete not set causing some delete-orphan .clear() to fail
- * [ANN-123] - Support for Generics superclass
- * [ANN-124] - FIELD constant thing is wrong in the doc
- * [ANN-133] - Bytecode enhancement process adds non-transient properties to beans
- * [ANN-135] - Inconsistent range check between Range Validator class and generated DDL.
- * [ANN-136] - Validator annotations not applied to the hibernate metamodel for id properties
- * [ANN-139] - SINGLE_TABLE inheritance raise an WrongClassException under certain circumstances
- * [ANN-142] - Automatic Generation of Composite IDs - Annonation declaration fails
- * [ANN-151] - <subclass extends= broken when using AnnotationConfiguration
- * [ANN-152] - Indexes generated by the LuceneEventListener are deleted at startup (Mattias Arbin)
- * [ANN-156] - MapKey Cannot Map @Id when using @IdClass
- * [ANN-165] - @Length(min=4) ie wo max generate a varchar(Integer.MAX_VALUE)
- * [ANN-171] - Class cast exception during processing of non getter generic methods
- * [ANN-173] - ClassValidator.getInvalidValues should not depend on equals() for circularity check
-
-** New Feature
- * [ANN-111] - add function for validating properties before bean creation
- * [ANN-116] - fetch validators from implemented interfaces
- * [ANN-125] - Validator does not preserve method hierarchy in InvalidValue[]
- * [ANN-127] - Add @Future
- * [ANN-128] - Externalize EJB3 namings to NamingStrategy
-
-
-** Improvement
- * [ANN-119] - Embedded international error messages
- * [ANN-121] - Named Queries should be package level visible
- * [ANN-126] - mention usage of columnDefinition as part of @Column in docs
- * [ANN-138] - Support collections of value types with separate annotation
- * [ANN-148] - EnumType should be aware of DababaseMetadata.storesUpperCaseIdentifiers() and co (Tim Fennell)
- * [ANN-149] - Do not check lazy/uninitialized fields in Validator
- * [ANN-153] - Customize the parent directory for indexes generated by LuceneEventListener (Mattias Arbin)
- * [ANN-154] - Customize Analyzer subclass for the LuceneEventListener (Mattias Arbin)
- * [ANN-168] - @FilterDef should support condition
- * [ANN-170] - Keep user order of hbm files (to ease the typedef usage)
-
-
-3.1beta6 Preview (07-10-2005)
------------------------------
- * ANN-105 More exception handling in AnnotationConfiguration
- * ANN-109 @Index does not support join columns references
- * ANN-93 Make Hibernate Validator Serializable Friendly
-
-3.1beta5 Preview (14-09-2005)
------------------------------
- * ANN-70 Lucene integration
- * ANN-13 Support for referencedColumnName referencing non PK columns for @ManyToMany
- * ANN-63 Use metadata.getUserName() when guessing Enum backing type (Scott Haug)
- * ANN-38 Finish the optional=false support
- * ANN-69 Expand the resource bundle message itself in the Validator framework
- * ANN-68 Apply validator on a particular property (Jesus Marin)
- * ANN-41 Allow field validations and validate private method (Chris Wood)
- * ANN-75 Support named (native) query parameters (from Carlos Gonzalez)
- * ANN-73 Use an eager strategy for the second join of a ManyToMany
- * ANN-74 Allow configuration artefacts (hbm, classes) loading precedence
- * ANN-79 Support collection of composite elements
- * ANN-19 Annotations should support collections of primitive and core types
- * ANN-77 Support primitive arrays
- * ANN-20 Support dotted annotation when using overriding (Alexei Akhounov)
- * ANN-55 @Proxy annotation should take proxyClass argument
- * ANN-2 Bidirectional true @OneToOne
- * ANN-80 @NotFound(action=NotFoundAction.IGNORE)
- * ANN-57 @Table ignores unique contraint in association table
- * ANN-3 Support of component inside SecondaryTable
- * ANN-87 @InheritanceJoinColumn rename is incomplete
- * ANN-81 ColumnDefinition not assigned when using @Column and @JoinColumn
- * ANN-34 Second passes binded to HbmBinder.SecondPass
- * NPE on Index and Unique constrains when column name has case inconsistency
- * ANN-86 @Index not used on properties having no @Column
- * ANN-49 Super class of Embeddable not mapped correctly (Alexei Akhounov)
- * ANN-66 Null enums don't store to database correctly
- * ANN-65 Validator ignores components (the DDL still ignores it)
- * ANN-60 NPE when @EmbeddableSuperclass has a superclass @Entity
- * ANN-90 mention usage of @Column together with @Id explicitly
- * ANN-18 Document bean-level validator mecanism
-
-3.1beta4 Preview (04-08-2005)
------------------------------
- * ANN-54 EnumType fails to find the Enum in setParameterValues(Properties)
- * ANN-32 Support index creation
- * ANN-22 Hibernate 3 Annotations should support all Id generators
- * ANN-51 redeclaring id in entity subclass raises ClassCastException
- * ANN-43 @MapKey throw exception if key is id or a component subproperty
- * ANN-52 Exception when @OrderBy contains the id property or a component subproperty
- * ANN-13 Support for referencedColumnName referencing non PK columns for @ManyToOne, @OneToOne and @OneToMany
- * ANN-46 Raise a warning on @Filter on subclasses
- * ANN-48 @UniqueConstraint reorders columns (Chris Wood)
- * ANN-6 enum did not worked for enums persisted in string based columns (MySql and Oracle)
- * ANN-8 array of primitive no longer create a non null column
- * ANN-45 Proper support for @Basic byte[]
- * ANN-44 Don't mandate to list embedded superclasses
- * ANN-42 Don't mandate resultset to be defined before named native queries
- * ANN-11 More robust support for enum persistence (wider range of SQL types)
- * HBX-307 Remove @Serialized and support @Lob tagging of a serializable type
-
-3.1beta3 Preview (24-06-2005)
------------------------------
- * Rename @AssociationTable to @JoinTable
- * HBX-213 support of @IdClass
- * change targetEntity from String to Class
- * HBX-305 Support Java5 Enums
- * Add @Basic(optional=false) and Lob(optional=false)
- * HBX-284 AnnotationOverride in inheritance in conjunction with @EmbeddedSuperclass
- * HBX-304 @AttributeOverride instead of @Embedded(override=@AttributeOverride) or @EmbeddedId(...)
- * HBX-290 All collection binder exception now show the collection role
- * HBX-299 Fix test suite error on MySql
- * HBX-302 @MapKey(name="propertyName") to map a map using a property of the associated class as a map key
- * HBX-201 @Formula on properties or fields.
- * Support @EntityResult(discriminatorColumn)
- * Relax List usage as per the spec (non indexed list are defaulted to bag semantic)
- * HBX-300 enable HQL order by fragment using @javax.persistence.OrderBy
- * HBX-298 FKs on association tables are forced not null
- * HBX-297 Primitive types creates a non null constrained column if defaulted and not SINGLE_TABLE (HBX-301)
- * HBX-287 @DiscriminatorFormula
- * HBX-205 @OnDelete(action=OnDeleteAction.CASCADE) for joined subclasses and collections
- * Change @OneToOne(usePkasFk=true) into @PrimaryKeyJoinColumn
- * Rename @InheritanceJoinColumn/@InheritanceJoinColumns to @PrimaryKeyJoinColumn/@PrimaryKeyJoinColumns
- * Support @Basic(temporalType=...)
- * HBX-282 protect @ManyToMany from abusive not joined filters
- * Align with @NamedNativeQuery/@NamedNativeQueries
- * HBX-283 Better getter resolution
- * HBX-75 Implicit inheritance join columns declaration in composite PK
- * HBX-54 Explicit exception when @Id is missing
- * HBX-210 Fix NPE when the @Id was on the superclass of the root entity in conjonction with @OneToOne use
- * HBX-280/HBX-157 Support @EmbeddabledSuperclass
-
-3.0beta2 Preview (27-05-2005)
------------------------------
- * HBX-87 fetching method is now used even when loading through a query
- * Add the validate framework and bind it to the annotation binder.
- * HBX-199 Support @Columns and thus multi-column properties (ie composite user types)
- * HBX-206 Support @OrderBy and @Sort
- * HBX-203/HBX-81 Support Hibernate cascade strategies through @Cascade (Pablo Nussembaum)
- * HBX-47 Persist is cascaded on flush operation when using the EJB3 event listeners
- * HBX-125 Support for named native SQL queries (not Scalar results)
- * HBX-225 @Type annotation now work for @Id and @Version (Pablo Nussembaum, Emmanuel Bernard)
- * HBX-248 TABLE_PER_CLASS no longer limited to leaf entities and use union-subclass as its strategy
- * HBX-186 inheritance strategy no longer have to be defined on every entity (only on root entry)
- * HBX-53 Annotated classes can be defined in any arbitrary order
- * Support Array through @IndexColumn (Anthony Patricio)
- * HBX-216 Ignore static fields and properties
- * HBX-229/HBX-134 Filter javac generated methods that compensate type erasure aka bridge method (Rog�rio Gatto)
- * HBX-184 Support List mappings through @IndexColumn (Matthiew Inger, Emmanuel Bernard)
- * HBX-187 Move to a CollectionBinder structure (Matthiew Inger, Emmanuel Bernard)
- * Fix of CascadeType.REMOVE
-
-3.0beta1 Preview (07-04-2005) based on the EJB3 Early Draft 2
--------------------------------------------------------------
- * support parameters in @Type (HBX-197)
- * support @TypeDef at package and class level
- * HBX-166 support @Lob for Character[],char[], String, byte[] and Byte[] (experimental)
- * HBX-159/HBX-140 add @Filter(s) and @FilterDef(s) (Matthew Inger, Magnus Sandberg)
- * HBX-44 @OneToOne support composite PK
- * @OneToOne is supported except for true bidirectional @OneToOne
- * Add @Cache annotation: allow to define caching on root entities and on collections (,eg @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL, region="specificCacheRegion") )
- * Support @OneToMany default (ie using an association table)
- * HBX-164 insertable/updatable of @JoinColumn now work in @ManyToOne processing (Mario Ivankovits, Emmanuel Bernard)
- * HBX-153 @Id(generate=GeneratorType.AUTO, generator="my_potential_sequence") now work (Pablo Nussembaum)
- * Support @ManyToMany wo @AssociationTable (ie defaults)
- * Support @ManyToMany(mappedBy)
- * Support @OneToMany(mappedBy) (no JoinColumn needed on the @OneToMany side)
- * Appropriate default value when no @JoinColumn is defined in a ManyToOne
- * rename @GeneratorTable to @GeneratedIdTable
- * rename CREATE to PERSIST, add REFRESH cascade style
- * support Mapping Defaults for Non-Relationship Fields or Properties algorithm as defined in the EJB3 spec
- * support @Serialized
- * support @Lob for java.sql.Clob and java.sql.Blob
- * allow embedded object declaration wo @Embeddable (if @Embedded or @EmbeddedId is present in the property)
- * support for @EmbeddedId
- * rename DependentAttribute to AttributeOverride, Dependent to Embedded and DependentObject to Embeddable
- * support @ManyToOne in embedded objects
- * support for @NamedQuery and @NamedQueries (EJBQL)
- * move javax.ejb.* into javax.persistence.* and update copyright header
-
-3.0alpha3 (28-02-2005)
-----------------------
-* HBX-116 Support for Where clause in classes and collections @Where(clause="")
-* HBX-115 Support for class proxying configuration: @Proxy(lazy=false, proxyClassName="my.Interface")
-* HBX-88 Support for hibernate type abstraction through @Type (only on basic properties for now)
-* HBX-108 Support @BatchSize(size=n) for entities and collections
-* HBX-107 implements @org.hibernate.annotations.Entity
-* HBX-103 handle abstract classes
-* HBX-83 precision & scale support for column (Bogdan Ghidireac)
-
-3.0alpha2 (25-01-2005)
-----------------------
-* HBX-61 Support for @UniqueConstraint (except primaryKey=true)
-* HBX-60 Support for a proper @TableGenerator (using MultipleHiLoPerTableGenerator)
-* HBX-63 Support @GeneratorTable
-* HBX-68 Add declarative configuration of annotated classes
-* HBX-74 Rollback the HB-1315 fix: dialect no longer have to be set in hibernate.properties
-
-
-Hibernate-annotations-3.0alpha1 based on the EJB3 Early Draft 1 (6.01.2005)
----------------------------------------------------------------------------
-* Support for EJB3 annotations:
- - @Transient
- - @Column (not primaryKey)
- - @JoinColumn (referencedColumnName - only for a reference to a PK, not primaryKey)
- - @Version
- - @Basic
- - @Entity
- - @Table (not uniqueConstraints)
- - @AccessType
- - @Id
- - @CascadeType
- - @FetchType
- - @GeneratorType (NONE, IDENTITY, TABLE, SEQUENCE)
- - @TableGenerator (with scope visibility)
- - @SequenceGenerator (with scope visibility, does not support initialValue() and allocationSize())
- - *not* @GeneratorTable (will have to write a new TableHiloGenerator, but it can wait)
- - @ManyToOne (not optional)
- - @OneToMany (Set and Collection, generics version or not, JoinColumn not guessed)
- - @OneToOne
- but not optional
- no composite PK/FK
- - @ManyToMany
- - @AssociationTable (Has to be on both sides)
- - @Inheritance
- - @InheritanceType (has to be defined on every classes of the hierarchy for JOINED strategy,
- not very clear about the TABLE_PER_CLASS strategy)
- - @DiscriminatorColumn
- - @DiscriminatorType
- - @InheritanceJoinColumn
- - @InheritanceJoinColumns
- this annotation for Composite PK Entities has to be explicit, I do not respect the implicit semantic of the EJB3 spec
- - @SecondaryTable (@OneToMany @JoinColumn(secondaryTable="..." does not work yet due to H3 core issue HHH-36
- - @SecondaryTables
- this annotation for Composite PK Entities has to be explicit, I do not respect the implicit semantic of the EJB3 spec
- - @DependentObject
- - @Dependent
- - @DependentAttribute (only for basic properties as per the spec)
- - @Id in conjunction with @DependentObject (composite primary keys)
- - @JoinColumns in conjunction with @ManytoOne, @OneToMany, @ManytoMany
- - note that the composite FK columns have to be in the same table (no != secondary tables). This is probably a weird case and certainly a not recommanded one.
-
-
-Still missing or incomplete features compared to the EJB3 spec
---------------------------------------------------------------
- - use of referencedColumnName for column other than the PK ones @ManyToMany (HBX-62)
- - Support for a true bidirectional one to one relationship (HBX-177)
- - support for initialValue and allocationSize in @SequenceGenerator (HBX-59)
- - finish support of optional=false (HBX-190)
\ No newline at end of file
Deleted: core/trunk/entitymanager/changelog.txt
===================================================================
--- core/trunk/entitymanager/changelog.txt 2010-01-12 20:19:32 UTC (rev 18523)
+++ core/trunk/entitymanager/changelog.txt 2010-01-12 21:00:11 UTC (rev 18524)
@@ -1,383 +0,0 @@
-Hibernate EntityManager Changelog
-==================================
-
- 3.4.0.GA (20-08-2008)
-----------------------
-
-** Bug
- * [EJB-375] - getSingleResult potentially generates out of memory by calling list()
-
-** Task
- * [EJB-377] - Refactor build to allow filtering of resources
-
-
-3.4.0.CR2 (01-08-2008)
-----------------------
-
-** Bug
- * [EJB-349] - EM Incorrectly throws EntityExistsException wrapping ConstraintViolationException on constraint violation during delete
-
-
-3.4.0.CR1 (27-05-2008)
-----------------------
-
-** Improvement
- * [EJB-359] - Move to slf4j
-
-** New Feature
- * [EJB-352] - Add pom
- * [EJB-353] - Make build independent of Hibernate Core structure
- * [EJB-354] - Move to Hibernate Core 3.3
-
-
-3.3.2.GA (14-03-2008)
----------------------
-
-** Bug
- * [EJB-324] - Deployed Maven POM incorrectly excludes transitive dependency
- * [EJB-342] - event listener (prepersist, preinsert) not firing
-
-
-3.3.2.CR1 (06-03-2008)
-----------------------
-
-** Bug
- * [EJB-295] - External META-INF/orm.xml not included even when explicitly requested when an internal orm.xml is already present
- * [EJB-330] - Calling configure(String) on Ejb3Configuration before addAnnotatedClass(..) breaks callbacks
- * [EJB-333] - Space in path result in error during deployment in JBoss AS
- * [EJB-334] - Space in path result in error during deployment in JBoss AS
- * [EJB-340] - onLoad() callback from Interceptor and onLoad() from Lifecycle are never invoked in an EJB3 environment
- * [EJB-341] - Trying to create unexisting named query set the transaction to rollback
-
-
-3.3.2.Beta2 (15-01-2008)
-------------------------
-
-** Bug
- * [EJB-283] - Ejb3Configuration can't read Jar file OC4J
- * [EJB-299] - JarVisitor.addElement() fails with a StringIndexOutOfBoundsException if there is a package-info.class in the default package
- * [EJB-326] - Persistence unit root in a WAR not properly handled
-
-
-** Improvement
- * [EJB-277] - allow string values for query hints
-
-** New Feature
- * [EJB-305] - New configuration option for non-shared Hibernate interceptor
- * [EJB-325] - Any PersistenceExceptions should state which persistenceunit they are from
-
-
-3.3.2.Beta1 (31-10-2007)
-------------------------
-
-** Bug
- * [EJB-284] - Scanning for META-INF/orm.xml does not work on Windows in EE mode
- * [EJB-308] - Space in path result in error during deployment in JBoss AS
- * [EJB-310] - Typo in warn message when the container lacks temporary classloader support
- * [EJB-321] - TCK enforces PERSISTENCE_PROVIDER value including the typo
-
-
-** Improvement
- * [EJB-316] - java.persistence.Persistence#PERSISTENCE_PROVIDER should be a final String
-
-
-
-** Task
- * [EJB-302] - Move away from ArchiveBrowser and use JarVisitor
-
-
-3.3.1.GA (28-03-2007)
----------------------
-
-** Bug
- * [EJB-280] - java.lang.NoSuchMethodError: Hibernate EM 3.3.0 breaks Jboss Embedded EJB3 due to method signature change
- * [EJB-281] - Version 3.3.0 is not compatible with JBoss AS 4.0.5
- * [EJB-282] - ORM.xml ignored when excludeUnlistedClass = true in container mode (EJB 3.0, Spring)
-
-
-3.3.0.GA (19-03-2007)
----------------------
-
-** Bug
- * [EJB-46] - PrePersist callback method not called if entity's primary key is null
- * [EJB-257] - EJB3Configuration should work wo having to call any of the configure(*)
- * [EJB-259] - Evaluate orm.xml files in referenced jar files
- * [EJB-261] - merge fails to update join table
- * [EJB-263] - getSingleResult() and fetch raise abusive NonUniqueResultException
- * [EJB-269] - Fail to deploy a persistence archive in Weblogic Server
- * [EJB-275] - JarVisitor fails on WAS with white space
-
-
-** Improvement
- * [EJB-242] - Be more defensive regarding exotic (aka buggy) URL protocol handler
- * [EJB-262] - Provides XML file name on parsing error
- * [EJB-271] - Raise a WARN when deployment descriptors (orm.xml) refer to an unknown property (increase usability)
- * [EJB-266] - Avoid collection loading during cascaded PERSIST (improving performance on heavily cascaded object graphs)
-
-
-3.2.1.GA (8-12-2006)
---------------------
-
-** Bug
- * [EJB-226] - JarVistor.getVisitor does not handle paths containing spaces correctly for an exploded par
- * [EJB-229] - merge fails with detached obj in 1:1 relationship
- * [EJB-237] - merge() causes version to increase
- * [EJB-240] - attribute-override and embedded in orm.xml not working
- * [EJB-244] - JarVisitor fails on exploded archives with spaces in path
- * [EJB-247] - HibernatePersistence does not play well with other PersistenceProviders
- * [EJB-252] - Clarify documentation on package use in persistence.xml <class> (and it's meaning)
- * [EJB-253] - Support Weblogic JAR URL in JavaSE mode
-
-
-** Improvement
- * [EJB-232] - Better documentation for <jar-file> and scanning outside of PU root
- * [EJB-243] - Error in Documentation: persistence.xml for typical Java SE Environment
- * [EJB-246] - Consider being in a JavaEE container when jta-datasource is used
- * [EJB-248] - Wrap StaleStateException into an OptimisticLockException during em.getTransaction().commit()
- * [EJB-254] - Allow DataSource overriding through createEntityManager(String, Map override)
- * [EJB-256] - Avoid JAR locking on Windows and Tomcat due to URLConnection caching
-
-
-3.2.0.GA (16-10-2006)
----------------------
-Same code base as 3.2.0.CR3
-
-** Task
- * [EJB-239] - Add EJB 3.0 JavaDoc to the distribution
-
-
-3.2.0.CR3 (04-10-2006)
-----------------------
-** Bug
- * [EJB-150] - JarVisitor.addElement does not close passed input streams
- * [EJB-221] - TransientObjectException with FetchType.LAZY on @ManyToOne and field access on target entity
- * [EJB-231] - Optimistic locking exception could lead to java.lang.IllegalArgumentException: id to load is required for loading
-
-
-** Improvement
- * [EJB-234] - Inefficiency during the flush operation
-
-
-3.2.0.CR2 (16-09-2006)
-----------------------
-** Bug
- * [EJB-98] - EntityManager.find() throws an org.hibernate.ObjectDeletedException if you find something deleted in the same TXA
- * [EJB-148] - Incorrect exception when @CollectionOfElement is used with @Where and FetchType is EAGER
- * [EJB-174] - Ejb3Configuration can't open EJB Jar file with persistence.xml in Oracle OC4J server (Jifeng Liu)
- * [EJB-181] - ExplodedJarVisitor and paths with white spaces
- * [EJB-185] - Some EJB3 exceptions does not support nested exceptions
- * [EJB-187] - RuntimeException raised in CallBack methods should be left as is
- * [EJB-188] - @PostUpdate can be called even if @PreUpdate is not when object is in DELETED state
- * [EJB-189] - em.getReference() should raise IllegalArgumentException if the id is of the wrong type
- * [EJB-190] - Query.setParameter() should raise an IllegalArgumentException if the parameter does not exist
- * [EJB-191] - Incoherent usage of getResultList(), executeUpdate() or getSingleResult() regarding the DML/Select style should raise an IllegalStateException
- * [EJB-194] - Removing a detached instance is not allowed
- * [EJB-195] - Wrong query should raise an IllegalArgumentException
- * [EJB-196] - referencing a transient instance while flushing an association non cascaded should raise IllegalStateException
- * [EJB-198] - On em.close(), tries to register the transaction even if the transaction is marked for rollback
- * [EJB-202] - Inaccurate exception message for setFirstResult in QueryImpl
- * [EJB-203] - exception when using top-level <access>PROPERTY</access> in orm.xml
- * [EJB-204] - ClassCastException when using <mapped-superclass> in orm.xml
- * [EJB-205] - refresh() should raise IllegalArgumentException if the entity is not managed
- * [EJB-207] - em.lock(..., WRITE) raise NPE on some DBs
- * [EJB-212] - excludeUnlistedClasses ignored in SE case
- * [EJB-214] - Native Query can not be used with parameter
- * [EJB-215] - EntityManager fails during transaction commit after it has been closed
- * [EJB-216] - Query.getSingleResult() whose state-field is null raise an EntityNotFoundException rather than returning null
- * [EJB-218] - markForRollback() should not swallow the original exception
- * [EJB-220] - Entity listener documentation contradicts EJB3 specification
- * [EJB-223] - EntityNotFoundDelegate not Serializable
-
-
-** Improvement
- * [EJB-82] - Query interface should support parameter lists for positions
- * [EJB-182] - Add Websphere proprietary jar protocol
- * [EJB-186] - Set the default cache provider to NoCache to prevent PU misuse to raise exceptions
- * [EJB-201] - Ejb3Configuration should output a warning if no persistence.xml is found
- * [EJB-210] - OptimisticLockStrategy should expose the underlying stale entity
- * [EJB-211] - JavaDoc the EJB 3 API
-
-** New Feature
- * [EJB-154] - Allow to create/configure an EJB3Configuration without building a sessionfactory
- * [EJB-160] - Push EJB3Configuration and SessionFactory into JNDI
- * [EJB-184] - Add EM property for FlushMode
-
-
-3.2.0.CR1 (13-05-2006)
-----------------------
-** Bug
- * [EJB-9] - Proxied instances should raise ENFE not LIE
- * [EJB-59] - count(*) return Integer and not Long
- * [EJB-101] - callback method overriding should avoid supermethod calls
- * [EJB-116] - The EntityManager's configuration overwites configurations from the hibernate.cfg.xml file
- * [EJB-167] - EntityManager must return null, if entity does not exist.
- * [EJB-168] - Do not register Synchronization on Transaction marked as rollback
- * [EJB-169] - MappingException thrown when META-INF/orm.xml is not found
- * [EJB-173] - Resetting joined transaction state on a closed entity manager raise an exception
- * [EJB-177] - in beforeCompletion phase, the transaction might not be returned causing an NPE
-
-
-** Improvement
- * [EJB-84] - Integrate the ClassFileTransformer and pass the appropriate entities to enhance
- * [EJB-159] - RESOURCE_LOCAL should be default in JavaSE
- * [EJB-172] - Use Hibernate abstraction of the ByteCodeEnhancer for class file transformation
- * [EJB-175] - Support for createNativeQuery.executeUpdate()
-
-** New Feature
- * [EJB-165] - Support interceptor and callback XML overriding
- * [EJB-170] - Try to find <mapping-file/> in the parsed JAR before delegating to the regular resource locator
-
-
-3.1.0.Beta8b (27-04-2006)
--------------------------
-
-** Bug
- * [EJB-121] - FileZippedJarVisitor can not handle URL with white spaces in windows XP professional.
- * [EJB-155] - assumes Map.Entry where string is returned
- * [EJB-156] - Setting a transaction factory raise an assertion failure
- * [EJB-166] - StaleObjectStaleException not wrapped into an optimisticLockException when merge is used
-
-
-
-** New Feature
- * [EJB-157] - Display the version number at init time to avoid user confusion regarding the version used
- * [EJB-164] - Support for EJB3 mapping files and META-INF/orm.xml
-
-
-3.1beta7 (27-03-2006)
----------------------
-
-** Bug
- * [EJB-37] - Check all the spec exceptions to be sure we raise the right ones
- * [EJB-80] - EMF bootstrapping doesn't work as documented
- * [EJB-96] - Spelling error in 2.4 section of reference doc
- * [EJB-114] - NPE when Persistence.createEntityManager(String) is used
- * [EJB-115] - wrong loglevel in PersistenceXmlLoader.java (line 101)
- * [EJB-118] - PersistenceXmlLoader logging a fail message
- * [EJB-119] - @EntityResult definition is not correct
- * [EJB-123] - Exception "EntityManager is closed" throwed when trying to check isOpen()
- * [EJB-125] - Can't use Hibernate's FlushMode.NEVER with an EntityManager
- * [EJB-134] - javax.persistence.OptimisticLockException not thrown
- * [EJB-139] - em.getTransaction() should raise IllegalStateException if accessed on a JTA EM
- * [EJB-145] - Support EntityManager.joinTransaction()
-
-
-** Improvement
- * [EJB-77] - Getting access to the annotationconfiguration behind a Ejb3Configuration
- * [EJB-135] - em.close() should close the API but let the EM in sync with the attached transaction
- * [EJB-147] - Validate persistence.xml file from persistence_1_0.xsd
-
-** New Feature
- * [EJB-90] - Mark transaction for Rollbacked on PersistenceException
- * [EJB-106] - EntityManager.lock( , LockModeType.WRITE)
- * [EJB-117] - extra persist() queue
- * [EJB-137] - Implements EntityExistsException
- * [EJB-138] - Implements EntityTransaction.setRollbackOnly()
- * [EJB-141] - Update EntityManagerFactory interface by removing PersistenceContextType and adding the overriding map
- * [EJB-142] - RollbackTransaction on JTA should clear the persistence context
- * [EJB-143] - Set the transaction_factory automatically from Transaction_type unless explicitly set
- * [EJB-144] - Failure of EntityTransaction.commit() should rollback();
-
-
-** Task
- * [EJB-107] - Check use of persistenceUnitInfo.getClassLoader()
-
-
-3.1beta6 (20-01-2006)
----------------------
-** Bug
- * [EJB-93] - @PrePersist callback not called on cascade
- * [EJB-110] - misnamed method in PersistenceUnitInfo
- * [EJB-111] - close() throws IllegalStateException( "transaction in progress")
-
-** New Feature
- * [EJB-50] - Entity callbacks should handle subclassing
- * [EJB-83] - PersistentUnitInfo and new persistence.xml schema as per the pfd
- * [EJB-85] - Support CUD operations out of transactions
- * [EJB-86] - EntityManager.getFlushMode()
- * [EJB-87] - EntityManager.lock( , LockModeType.READ)
- * [EJB-88] - EntityManager.clear()
- * [EJB-89] - Replace EntityNotFoundException to NoResultException for query.getSingleResult()
- * [EJB-91] - persistence.xml structure changes as per the PFD
- * [EJB-92] - Implements transactional-type
- * [EJB-104] - Flag for class file transformation
- * [EJB-108] - Support EJB3 overriding properties (provider, jta / non-jta datasource, transactionType) over persistence.xml
-
-
-** Improvement
- * [EJB-100] - Multiple lifecycle per event
- * [EJB-102] - EJB3 no longer requires to rollback the ids
-
-
-** Deprecation
- * [EJB-105] - Implicit positional parameters for EJBQL queries is no longer supported
-
-3.1beta5 (13-12-2005)
----------------------
-** Bug
- * [EJB-52] - PERSIST cascade loads unilitialized elements at flush time
- * [EJB-68] - hibernate.ejb.interceptor property in persistence.xml is ignored
- * [EJB-73] - Id is not set in @PostPersist
- * [EJB-76] - JarVisitor unqualify algorithm fails when the name ends with 'ar' and is less than 4 chars
- * [EJB-78] - default value for hibernate.transaction.flush_before_completion
-
-** New Feature
- * [EJB-58] - Support @MyAnnotation annotated with an @EntityListener
- * [EJB-71] - Support custom event listeners
-
-
-** Improvement
- * [EJB-35] - Support custom NamingStrategy as property.
- * [EJB-72] - Make setDataSource() more out of container friendly
- * [EJB-75] - Fall back to <property name="blah">blah</property> when the value attribute is empty
- * [EJB-79] - Package.getPackage() returns null on some classloaders
-
-
-3.1beta4 (07-10-2005)
----------------------
- * EJB-67 Lazy access to the stream in JarVisitor leading to a non access when filters are empty (ie no filters)
- * EJB-65 handle eclipse bundleresource url protocol during metadata search
- * EJB-66 Support all url protocols that returns zip streams for jars like http
- * EJB-62 Error during stateful session bean passivation
- * EJB-61 implicit parameter ? no longer supported
- * EJB-63 Positional parameters should start from index 1 to say sort of consistent with the spec
-
-3.1beta3 (14-09-2005)
----------------------
- * EJB-6 Support ?1, ?2 style positional parameters
- * EJB-60 Support byte code instrumentation via a ClassFileTransformer
- * EJB-55 Problems using a .par file with Tomcat
- * EJB-56 Support exploded jar files *not* ending with .xar
- * EJB-51 Support persistence.xml declaration and hibernate.cfg.xml
- * EJB-53 DELETE_ORPHAN not executed at flush time
- * EJB-52 Persist cascade loads uninitialized elements at flush time
- * EJB-43 Autodetection magic leads to duplicate imports
- * EJB-24 ByteArrayBlobType incompatible with Oracle
- * EJB-28 create an EMF through PersistenceInfo
- * EJB-44 Support Hibernate Interceptors in EJB3 imlementation as an extension
- * EJB-40 Entity callbacks should cast away access modifiers
- * EJB-48 Plug Validator framework into HEM
- * EJB-47 Validator and Jacc event listeners clashes
-
-3.1beta2 (04-08-2005)
----------------------
- * Support package names in <class></class>
- * EJB-42 Autodetection magic ignores hibernate.cfg.xml
- * EJB-45 Allow to disable autodetection in .par through a property
- * EJB-41 Short-circuit dirty checking when no callback are actually called
- * EJB-38 Standalone EM should search for package-info files
- * EJB-31 Out-of-container should search for .hbm.xml files
- * EJB-29 Lifecycle callbacks and dirty checking clash
- * EJB-36 proxied instances raise an exception in em.contains()
- * EJB-28 support injected DataSource
- * EJB-34 EMF.isOpen() is wrong
- * EJB-27 Support transaction-less operations with getEntityManager()
- * EJB-23 No lifecycle interceptor used when getCurrentSession() is called
- * EJB-20 Sync Hibernate *state* and entity on lifecycle @Callbacks
- * EJB-21 NPE in TransactionImpl.isActive() when tx is not initialized (Shane Bryzak)
- * EJB-19 <jar-file/> analysed, but the resource path is mandatory and not only the jar name
- * EJB-18 get mapped classes from .par files both exploded and regular zip
-
-3.1beta1 Preview (24-06-2005)
------------------------------
-Initial release
\ No newline at end of file
14 years, 4 months