Hibernate SVN: r18770 - core/tags.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-02-10 14:19:17 -0500 (Wed, 10 Feb 2010)
New Revision: 18770
Added:
core/tags/hibernate-3.5.0-CR-1/
Log:
tagging 3.5.0-CR-1
Copied: core/tags/hibernate-3.5.0-CR-1 (from rev 18769, core/trunk)
16 years, 2 months
Hibernate SVN: r18769 - in core/trunk: annotations and 31 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-02-10 14:17:55 -0500 (Wed, 10 Feb 2010)
New Revision: 18769
Modified:
core/trunk/annotations/pom.xml
core/trunk/cache-ehcache/pom.xml
core/trunk/cache-infinispan/pom.xml
core/trunk/cache-jbosscache/pom.xml
core/trunk/cache-oscache/pom.xml
core/trunk/cache-swarmcache/pom.xml
core/trunk/connection-c3p0/pom.xml
core/trunk/connection-proxool/pom.xml
core/trunk/core/pom.xml
core/trunk/distribution/pom.xml
core/trunk/documentation/envers/pom.xml
core/trunk/documentation/jbosscache2/pom.xml
core/trunk/documentation/manual/old/es-ES/pom.xml
core/trunk/documentation/manual/old/fr-FR/pom.xml
core/trunk/documentation/manual/old/ja-JP/pom.xml
core/trunk/documentation/manual/old/ko-KR/pom.xml
core/trunk/documentation/manual/old/pt-BR/pom.xml
core/trunk/documentation/manual/old/zh-CN/pom.xml
core/trunk/documentation/manual/pom.xml
core/trunk/documentation/pom.xml
core/trunk/entitymanager/pom.xml
core/trunk/envers/pom.xml
core/trunk/hibernate-maven-plugin/pom.xml
core/trunk/jdbc3-testing/pom.xml
core/trunk/jdbc4-testing/pom.xml
core/trunk/jmx/pom.xml
core/trunk/parent/pom.xml
core/trunk/pom.xml
core/trunk/testing/pom.xml
core/trunk/testsuite/pom.xml
core/trunk/tutorials/eg/pom.xml
core/trunk/tutorials/pom.xml
core/trunk/tutorials/web/pom.xml
Log:
prep 3.5.0-CR-1 release
Modified: core/trunk/annotations/pom.xml
===================================================================
--- core/trunk/annotations/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/annotations/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -22,16 +22,14 @@
~ 51 Franklin Street, Fifth Floor
~ Boston, MA 02110-1301 USA
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-ehcache/pom.xml
===================================================================
--- core/trunk/cache-ehcache/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/cache-ehcache/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-infinispan/pom.xml
===================================================================
--- core/trunk/cache-infinispan/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/cache-infinispan/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-jbosscache/pom.xml
===================================================================
--- core/trunk/cache-jbosscache/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/cache-jbosscache/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<!--
~ Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
~ indicated by the @author tags or express copyright attribution
@@ -26,7 +27,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-oscache/pom.xml
===================================================================
--- core/trunk/cache-oscache/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/cache-oscache/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-swarmcache/pom.xml
===================================================================
--- core/trunk/cache-swarmcache/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/cache-swarmcache/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/connection-c3p0/pom.xml
===================================================================
--- core/trunk/connection-c3p0/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/connection-c3p0/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/connection-proxool/pom.xml
===================================================================
--- core/trunk/connection-proxool/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/connection-proxool/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/core/pom.xml
===================================================================
--- core/trunk/core/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/core/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/distribution/pom.xml
===================================================================
--- core/trunk/distribution/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/distribution/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
@@ -24,7 +23,6 @@
~ Boston, MA 02110-1301 USA
~
-->
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -32,7 +30,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/envers/pom.xml
===================================================================
--- core/trunk/documentation/envers/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/envers/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/jbosscache2/pom.xml
===================================================================
--- core/trunk/documentation/jbosscache2/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/jbosscache2/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
@@ -24,17 +23,14 @@
~ Boston, MA 02110-1301 USA
~
-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/manual/old/es-ES/pom.xml
===================================================================
--- core/trunk/documentation/manual/old/es-ES/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/manual/old/es-ES/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-manual-parent</artifactId>
- <version>1</version>
+ <version>3.5.0-CR-1</version>
</parent>
<groupId>org.hibernate</groupId>
Modified: core/trunk/documentation/manual/old/fr-FR/pom.xml
===================================================================
--- core/trunk/documentation/manual/old/fr-FR/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/manual/old/fr-FR/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-manual-parent</artifactId>
- <version>1</version>
+ <version>3.5.0-CR-1</version>
</parent>
<groupId>org.hibernate</groupId>
Modified: core/trunk/documentation/manual/old/ja-JP/pom.xml
===================================================================
--- core/trunk/documentation/manual/old/ja-JP/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/manual/old/ja-JP/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-manual-parent</artifactId>
- <version>1</version>
+ <version>3.5.0-CR-1</version>
</parent>
<groupId>org.hibernate</groupId>
Modified: core/trunk/documentation/manual/old/ko-KR/pom.xml
===================================================================
--- core/trunk/documentation/manual/old/ko-KR/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/manual/old/ko-KR/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-manual-parent</artifactId>
- <version>1</version>
+ <version>3.5.0-CR-1</version>
</parent>
<groupId>org.hibernate</groupId>
Modified: core/trunk/documentation/manual/old/pt-BR/pom.xml
===================================================================
--- core/trunk/documentation/manual/old/pt-BR/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/manual/old/pt-BR/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-manual-parent</artifactId>
- <version>1</version>
+ <version>3.5.0-CR-1</version>
</parent>
<groupId>org.hibernate</groupId>
Modified: core/trunk/documentation/manual/old/zh-CN/pom.xml
===================================================================
--- core/trunk/documentation/manual/old/zh-CN/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/manual/old/zh-CN/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-manual-parent</artifactId>
- <version>1</version>
+ <version>3.5.0-CR-1</version>
</parent>
<groupId>org.hibernate</groupId>
Modified: core/trunk/documentation/manual/pom.xml
===================================================================
--- core/trunk/documentation/manual/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/manual/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/pom.xml
===================================================================
--- core/trunk/documentation/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/documentation/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/entitymanager/pom.xml
===================================================================
--- core/trunk/entitymanager/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/entitymanager/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/envers/pom.xml
===================================================================
--- core/trunk/envers/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/envers/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/hibernate-maven-plugin/pom.xml
===================================================================
--- core/trunk/hibernate-maven-plugin/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/hibernate-maven-plugin/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -27,7 +27,7 @@
<parent>
<artifactId>hibernate-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/jdbc3-testing/pom.xml
===================================================================
--- core/trunk/jdbc3-testing/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/jdbc3-testing/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
@@ -27,7 +28,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -46,4 +47,3 @@
</dependencies>
</project>
-
Modified: core/trunk/jdbc4-testing/pom.xml
===================================================================
--- core/trunk/jdbc4-testing/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/jdbc4-testing/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
@@ -27,7 +28,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -68,4 +69,3 @@
</dependencies>
</project>
-
Modified: core/trunk/jmx/pom.xml
===================================================================
--- core/trunk/jmx/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/jmx/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/parent/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -22,9 +22,7 @@
~ 51 Franklin Street, Fifth Floor
~ Boston, MA 02110-1301 USA
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/testing/pom.xml
===================================================================
--- core/trunk/testing/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/testing/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,13 +1,12 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/testsuite/pom.xml
===================================================================
--- core/trunk/testsuite/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/testsuite/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/eg/pom.xml
===================================================================
--- core/trunk/tutorials/eg/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/tutorials/eg/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
@@ -24,7 +23,6 @@
~ Boston, MA 02110-1301 USA
~
-->
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -32,7 +30,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/pom.xml
===================================================================
--- core/trunk/tutorials/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/tutorials/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
@@ -23,7 +22,6 @@
~ 51 Franklin Street, Fifth Floor
~ Boston, MA 02110-1301 USA
-->
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -31,7 +29,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/web/pom.xml
===================================================================
--- core/trunk/tutorials/web/pom.xml 2010-02-10 19:08:50 UTC (rev 18768)
+++ core/trunk/tutorials/web/pom.xml 2010-02-10 19:17:55 UTC (rev 18769)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -5,7 +6,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-CR-1</version>
<relativePath>../pom.xml</relativePath>
</parent>
16 years, 2 months
Hibernate SVN: r18768 - core/trunk.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-02-10 14:08:50 -0500 (Wed, 10 Feb 2010)
New Revision: 18768
Modified:
core/trunk/changelog.txt
Log:
prep 3.5.0-CR-1 release
Modified: core/trunk/changelog.txt
===================================================================
--- core/trunk/changelog.txt 2010-02-10 17:38:59 UTC (rev 18767)
+++ core/trunk/changelog.txt 2010-02-10 19:08:50 UTC (rev 18768)
@@ -5,6 +5,48 @@
refer to the particular case on JIRA using the issue tracking number to learn
more about each case.
+
+Changes in version 3.5.0-CR-1 (2010.02.10)
+-------------------------------------------
+http://opensource.atlassian.com/projects/hibernate/browse/HHH/fixforversion/11014
+
+** Sub-task
+ * [HHH-4661] - Properly propagate Query.setLockMode to Hibernate Core
+ * [HHH-4664] - Implement EntityManagerFactory#getProperties()
+ * [HHH-4848] - Derived identities: Derived entities using @IdClass and mapping a @XToOne are not supported
+
+** Bug
+ * [HHH-4317] - Memory leak in EnumType class.
+ * [HHH-4824] - localpath appeared in the doc xml
+ * [HHH-4841] - Read-only proxies in NonFlushedChanges are not read-only when applied to a new session
+ * [HHH-4861] - Allow lookup by the "simple" pk type of "parent entity" in "derived identities" cases
+ * [HHH-4877] - "Check Nullability" logging incorrectness in SettingsFactory
+ * [HHH-4880] - EntityManager.refresh does not throw EntityNotFoundException for removed entity
+ * [HHH-4883] - Unable to join across a component
+ * [HHH-4884] - Fix binding of @TableGenerator#initialValue into org.hibernate.id.enhanced.TableGenerator
+ * [HHH-4889] - @IdClass containing an associated entity reference (instead of the pk of this associated entity) should still work
+ * [HHH-4895] - property mappings incorrect for composite ids with many-to-one
+ * [HHH-4896] - Read-only proxy targets initialized from second-level cache are not read-only
+ * [HHH-4898] - Results from read-only Criteria and Query obtained from query cache are not read-only
+ * [HHH-4900] - Wrong immutable type check in IdMetadataGenerator
+ * [HHH-4902] - Handle JPA 2 requirement of setting id attribute to non-null with its equivalent of foreign-generator
+
+** Improvement
+ * [HHH-4578] - Criteria is missing read-only flag
+ * [HHH-4704] - Pass session into EntityTuplizer#setIdentifier
+ * [HHH-4879] - Support HQL index-refering functions for many-to-many, indexed collections
+ * [HHH-4894] - Process composite-id sub-generators PersistentIdentifierGenerator contract(s)
+
+** New Feature
+ * [HHH-4731] - Public API to know if an entity class is audited
+
+** Patch
+ * [HHH-4886] - Merge minor change from IngresDialect.java from 3.3.2 for Ingres 9.2 compatibility
+
+** Task
+ * [HHH-4892] - Simplify testing of persistence packages
+
+
Changes in version 3.5.0-Beta-4 (2010.01.28)
-------------------------------------------
- http://opensource.atlassian.com/projects/hibernate/browse/HHH/fixforversi...
16 years, 2 months
Hibernate SVN: r18767 - in core/trunk: core/src/main/java/org/hibernate/event/def and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-02-10 12:38:59 -0500 (Wed, 10 Feb 2010)
New Revision: 18767
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/DerivedIdentitySimpleParentSimpleDepMapsIdTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/MedicalHistory.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/Person.java
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultPersistEventListener.java
Log:
HHH-4902 - Handle JPA 2 requirement of setting id attribute to non-null with its equivalent of foreign-generator
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/DerivedIdentitySimpleParentSimpleDepMapsIdTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/DerivedIdentitySimpleParentSimpleDepMapsIdTest.java 2010-02-10 17:34:16 UTC (rev 18766)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/DerivedIdentitySimpleParentSimpleDepMapsIdTest.java 2010-02-10 17:38:59 UTC (rev 18767)
@@ -1,7 +1,11 @@
package org.hibernate.test.annotations.derivedidentities.e4.b;
import java.util.Date;
+import java.util.List;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+
import org.hibernate.Session;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.util.SchemaUtil;
@@ -61,6 +65,45 @@
s.close();
}
+ public void testExplicitlyAssignedDependentIdAttributeValue() {
+ // even though the id is by definition generated (using the "foreign" strategy), JPA
+ // still does allow manually setting the generated id attribute value which providers
+ // are expected to promptly disregard :?
+ Session s = openSession();
+ s.beginTransaction();
+ Person person = new Person( "123456789" );
+ MedicalHistory medicalHistory = new MedicalHistory( "987654321", person );
+ s.persist( person );
+ s.persist( medicalHistory );
+ s.getTransaction().commit();
+ s.close();
+
+ // again, even though we specified an id value of "987654321" prior to persist,
+ // Hibernate should have replaced that with the "123456789" from the associated
+ // person
+ assertEquals( person.ssn, medicalHistory.patient.ssn );
+ assertEquals( person, medicalHistory.patient );
+ assertEquals( person.ssn, medicalHistory.id );
+
+ s = openSession();
+ s.beginTransaction();
+ // Should return null...
+ MedicalHistory separateMedicalHistory = (MedicalHistory) s.get( MedicalHistory.class, "987654321" );
+ assertNull( separateMedicalHistory );
+ // Now we should find it...
+ separateMedicalHistory = (MedicalHistory) s.get( MedicalHistory.class, "123456789" );
+ assertNotNull( separateMedicalHistory );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ s.delete( medicalHistory );
+ s.delete( person );
+ s.getTransaction().commit();
+ s.close();
+ }
+
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class<?>[] {
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/MedicalHistory.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/MedicalHistory.java 2010-02-10 17:34:16 UTC (rev 18766)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/MedicalHistory.java 2010-02-10 17:38:59 UTC (rev 18767)
@@ -1,6 +1,7 @@
package org.hibernate.test.annotations.derivedidentities.e4.b;
import java.util.Date;
+import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
@@ -16,11 +17,20 @@
public class MedicalHistory {
@Id String id; // overriding not allowed ... // default join column name is overridden @MapsId
+
+ @MapsId
+ @JoinColumn(name = "FK")
+ @OneToOne(cascade= CascadeType.ALL)
+ Person patient;
+
@Temporal(TemporalType.DATE)
Date lastupdate;
- @JoinColumn(name = "FK")
- @MapsId
- @OneToOne
- Person patient;
+ public MedicalHistory() {
+ }
+
+ public MedicalHistory(String id, Person patient) {
+ this.id = id;
+ this.patient = patient;
+ }
}
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/Person.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/Person.java 2010-02-10 17:34:16 UTC (rev 18766)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e4/b/Person.java 2010-02-10 17:38:59 UTC (rev 18767)
@@ -10,4 +10,11 @@
public class Person {
@Id
String ssn;
+
+ public Person() {
+ }
+
+ public Person(String ssn) {
+ this.ssn = ssn;
+ }
}
\ No newline at end of file
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/DefaultPersistEventListener.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/DefaultPersistEventListener.java 2010-02-10 17:34:16 UTC (rev 18766)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/DefaultPersistEventListener.java 2010-02-10 17:38:59 UTC (rev 18767)
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. 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.
+ * distributed under license by Red Hat Inc.
*
* 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
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.event.def;
@@ -32,10 +31,12 @@
import org.hibernate.ObjectDeletedException;
import org.hibernate.PersistentObjectException;
import org.hibernate.engine.CascadingAction;
+import org.hibernate.engine.EntityEntry;
import org.hibernate.event.EventSource;
import org.hibernate.event.PersistEvent;
import org.hibernate.event.PersistEventListener;
import org.hibernate.engine.SessionImplementor;
+import org.hibernate.id.ForeignGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.LazyInitializer;
@@ -48,7 +49,6 @@
* @author Gavin King
*/
public class DefaultPersistEventListener extends AbstractSaveEventListener implements PersistEventListener {
-
private static final Logger log = LoggerFactory.getLogger(DefaultPersistEventListener.class);
/**
@@ -69,19 +69,18 @@
* @throws HibernateException
*/
public void onPersist(PersistEvent event, Map createCache) throws HibernateException {
-
final SessionImplementor source = event.getSession();
final Object object = event.getObject();
final Object entity;
- if (object instanceof HibernateProxy) {
+ if ( object instanceof HibernateProxy ) {
LazyInitializer li = ( (HibernateProxy) object ).getHibernateLazyInitializer();
if ( li.isUninitialized() ) {
- if ( li.getSession()==source ) {
+ if ( li.getSession() == source ) {
return; //NOTE EARLY EXIT!
}
else {
- throw new PersistentObjectException("uninitialized proxy passed to persist()");
+ throw new PersistentObjectException( "uninitialized proxy passed to persist()" );
}
}
entity = li.getImplementation();
@@ -89,32 +88,58 @@
else {
entity = object;
}
-
- int entityState = getEntityState(
- entity,
- event.getEntityName(),
- source.getPersistenceContext().getEntry(entity),
- source
- );
-
- switch (entityState) {
- case DETACHED:
- throw new PersistentObjectException(
- "detached entity passed to persist: " +
- getLoggableName( event.getEntityName(), entity )
- );
+
+ final String entityName;
+ if ( event.getEntityName() != null ) {
+ entityName = event.getEntityName();
+ }
+ else {
+ entityName = source.bestGuessEntityName( entity );
+ event.setEntityName( entityName );
+ }
+
+ final EntityEntry entityEntry = source.getPersistenceContext().getEntry( entity );
+ int entityState = getEntityState( entity, entityName, entityEntry, source );
+ if ( entityState == DETACHED ) {
+ // JPA 2, in its version of a "foreign generated", allows the id attribute value
+ // to be manually set by the user, even though this manual value is irrelevant.
+ // The issue is that this causes problems with the Hibernate unsaved-value strategy
+ // which comes into play here in determining detached/transient state.
+ //
+ // Detect if we have this situation and if so null out the id value and calculate the
+ // entity state again.
+
+ // NOTE: entityEntry must be null to get here, so we cannot use any of its values
+ EntityPersister persister = source.getFactory().getEntityPersister( entityName );
+ if ( ForeignGenerator.class.isInstance( persister.getIdentifierGenerator() ) ) {
+ if ( log.isDebugEnabled() ) {
+ if ( persister.getIdentifier( entity, source ) != null ) {
+ log.debug( "Resetting entity id attribute to null for foreign generator" );
+ }
+ }
+ persister.setIdentifier( entity, null, source );
+ entityState = getEntityState( entity, entityName, entityEntry, source );
+ }
+ }
+
+ switch ( entityState ) {
+ case DETACHED:
+ throw new PersistentObjectException(
+ "detached entity passed to persist: " +
+ getLoggableName( event.getEntityName(), entity )
+ );
case PERSISTENT:
- entityIsPersistent(event, createCache);
+ entityIsPersistent( event, createCache );
break;
case TRANSIENT:
- entityIsTransient(event, createCache);
+ entityIsTransient( event, createCache );
break;
- default:
- throw new ObjectDeletedException(
- "deleted entity passed to persist",
- null,
+ default:
+ throw new ObjectDeletedException(
+ "deleted entity passed to persist",
+ null,
getLoggableName( event.getEntityName(), entity )
- );
+ );
}
}
16 years, 2 months
Hibernate SVN: r18766 - in core/branches/envers-hibernate-3.3/src: main/java/org/hibernate/envers/configuration/metadata and 7 other directories.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2010-02-10 12:34:16 -0500 (Wed, 10 Feb 2010)
New Revision: 18766
Added:
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java
Removed:
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java
Modified:
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/AuditReader.java
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/MapProxy.java
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/SortedMapProxy.java
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java
core/branches/envers-hibernate-3.3/src/test/resources/testng.xml
Log:
svn merge -r 18239:18765 https://svn.jboss.org/repos/hibernate/core/trunk/envers .\nNot merging the CompositeIds test from rev 18763
Modified: core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/AuditReader.java
===================================================================
--- core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/AuditReader.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/AuditReader.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -32,6 +32,7 @@
/**
* @author Adam Warski (adam at warski dot org)
+ * @author Hernan Chanfreau
*/
public interface AuditReader {
/**
@@ -121,4 +122,12 @@
* is closed.
*/
AuditQueryCreator createQuery();
+
+ /**
+ * Checks if the entityClass was configured to be audited.
+ *
+ * @param entityClass Class of the entity asking for audit support
+ * @return true if the entityClass is audited.
+ */
+ boolean isEntityClassAudited(Class<?> entityClass);
}
Modified: core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
===================================================================
--- core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -42,7 +42,6 @@
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.type.ImmutableType;
import org.hibernate.type.Type;
/**
@@ -62,7 +61,7 @@
Property property = properties.next();
Type propertyType = property.getType();
if (!"_identifierMapper".equals(property.getName())) {
- if (propertyType instanceof ImmutableType) {
+ if (!propertyType.isMutable()) {
// Last but one parameter: ids are always insertable
mainGenerator.getBasicMetadataGenerator().addBasic(parent,
getIdPersistentPropertyAuditingData(property),
Modified: core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/MapProxy.java
===================================================================
--- core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/MapProxy.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/MapProxy.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -36,7 +36,7 @@
public class MapProxy<K, V> implements Map<K, V>, Serializable {
private static final long serialVersionUID = 8418037541773074646L;
- private Initializor<Map<K, V>> initializor;
+ private transient Initializor<Map<K, V>> initializor;
protected Map<K, V> delegate;
public MapProxy() {
Modified: core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/SortedMapProxy.java
===================================================================
--- core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/SortedMapProxy.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/entities/mapper/relation/lazy/proxy/SortedMapProxy.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -38,7 +38,7 @@
public class SortedMapProxy<K, V> implements SortedMap<K, V>, Serializable {
private static final long serialVersionUID = 2645817952901452375L;
- private Initializor<SortedMap<K, V>> initializor;
+ private transient Initializor<SortedMap<K, V>> initializor;
protected SortedMap<K, V> delegate;
public SortedMapProxy() {
@@ -154,4 +154,4 @@
checkInit();
return delegate.hashCode();
}
-}
\ No newline at end of file
+}
Modified: core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java
===================================================================
--- core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -45,6 +45,7 @@
/**
* @author Adam Warski (adam at warski dot org)
+ * @author Hernan Chanfreau
*/
public class AuditReaderImpl implements AuditReaderImplementor {
private final AuditConfiguration verCfg;
@@ -209,4 +210,12 @@
public AuditQueryCreator createQuery() {
return new AuditQueryCreator(verCfg, this);
}
+
+ public boolean isEntityClassAudited(Class<?> entityClass) {
+ checkNotNull(entityClass, "Entity class");
+ checkSession();
+
+ String entityName = entityClass.getName();
+ return (verCfg.getEntCfg().isVersioned(entityName));
+ }
}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,40 @@
+/*
+ * 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.envers.test.entities.ids;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+public enum CustomEnum {
+ YES,
+ NO;
+
+ public String toYesNo() {
+ return this == YES ? "Y" : "N";
+ }
+
+ public static CustomEnum fromYesNo(String value) {
+ return "Y".equals(value) ? YES : NO;
+ }
+}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,99 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import java.io.Serializable;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.hibernate.HibernateException;
+import org.hibernate.usertype.UserType;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+public class CustomEnumUserType implements UserType {
+ private static final int[] SQL_TYPES = {Types.VARCHAR};
+
+ public int[] sqlTypes() {
+ return SQL_TYPES;
+ }
+
+ public Class returnedClass() {
+ return CustomEnum.class;
+ }
+
+ public boolean equals(Object x, Object y) throws HibernateException {
+ if (x == y) {
+ return true;
+ }
+ if ((x == null) || (y == null)) {
+ return false;
+ }
+ return x.equals(y);
+ }
+
+ public int hashCode(Object x) throws HibernateException {
+ return (x == null) ? 0 : x.hashCode();
+ }
+
+ public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
+ String name = rs.getString(names[0]);
+ if (rs.wasNull()) {
+ return null;
+ }
+ return CustomEnum.fromYesNo(name);
+ }
+
+ public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
+ CustomEnum val = (CustomEnum) value;
+ if (val == null) {
+ st.setNull(index, Types.VARCHAR);
+ } else {
+ st.setString(index, val.toYesNo());
+ }
+ }
+
+ public Object deepCopy(Object value) throws HibernateException {
+ return value;
+ }
+
+ public boolean isMutable() {
+ return false;
+ }
+
+ public Serializable disassemble(Object value) throws HibernateException {
+ return (Serializable) value;
+ }
+
+ public Object assemble(Serializable cached, Object owner) throws HibernateException {
+ return cached;
+ }
+
+ public Object replace(Object original, Object target, Object owner) throws HibernateException {
+ return original;
+ }
+}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,90 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import org.hibernate.envers.Audited;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class DateIdTestEntity {
+ @Id
+ private Date id;
+
+ @Audited
+ private String str1;
+
+ public DateIdTestEntity() {
+ }
+
+ public DateIdTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public DateIdTestEntity(Date id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public Date getId() {
+ return id;
+ }
+
+ public void setId(Date id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ DateIdTestEntity that = (DateIdTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id != null ? id.hashCode() : 0;
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,87 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import java.io.Serializable;
+import javax.persistence.Embeddable;
+
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+@Embeddable
+@TypeDef(name = "customEnum", typeClass = CustomEnumUserType.class)
+public class EmbIdWithCustomType implements Serializable {
+ private Integer x;
+
+ @Type(type = "customEnum")
+ private CustomEnum customEnum;
+
+ public EmbIdWithCustomType() {
+ }
+
+ public EmbIdWithCustomType(Integer x, CustomEnum customEnum) {
+ this.x = x;
+ this.customEnum = customEnum;
+ }
+
+ public Integer getX() {
+ return x;
+ }
+
+ public void setX(Integer x) {
+ this.x = x;
+ }
+
+ public CustomEnum getCustomEnum() {
+ return customEnum;
+ }
+
+ public void setCustomEnum(CustomEnum customEnum) {
+ this.customEnum = customEnum;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!(obj instanceof EmbIdWithCustomType)) return false;
+
+ EmbIdWithCustomType that = (EmbIdWithCustomType) obj;
+
+ if (x != null ? !x.equals(that.x) : that.x != null) return false;
+ if (customEnum != that.customEnum) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result;
+ result = (x != null ? x.hashCode() : 0);
+ result = 31 * result + (customEnum != null ? customEnum.hashCode() : 0);
+ return result;
+ }
+}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,83 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+
+import org.hibernate.envers.Audited;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+@Entity
+public class EmbIdWithCustomTypeTestEntity {
+ @EmbeddedId
+ private EmbIdWithCustomType id;
+
+ @Audited
+ private String str1;
+
+ public EmbIdWithCustomTypeTestEntity() {
+ }
+
+ public EmbIdWithCustomTypeTestEntity(EmbIdWithCustomType id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public EmbIdWithCustomType getId() {
+ return id;
+ }
+
+ public void setId(EmbIdWithCustomType id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!(obj instanceof EmbIdWithCustomTypeTestEntity)) return false;
+
+ EmbIdWithCustomTypeTestEntity that = (EmbIdWithCustomTypeTestEntity) obj;
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader)
Deleted: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -1,88 +0,0 @@
-/*
- * 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.envers.test.integration.auditReader;
-
-import java.util.Arrays;
-
-import javax.persistence.EntityManager;
-
-import org.hibernate.ejb.Ejb3Configuration;
-import org.hibernate.envers.exception.NotAuditedException;
-import org.hibernate.envers.test.AbstractEntityTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * A test which checks the correct behavior of AuditReader.isEntityClassAudited(Class entityClass).
- *
- * @author Hernan Chanfreau
- */
-public class AuditReaderAPITest extends AbstractEntityTest {
- public void configure(Ejb3Configuration cfg) {
- cfg.addAnnotatedClass(AuditedTestEntity.class);
- cfg.addAnnotatedClass(NotAuditedTestEntity.class);
- }
-
- @BeforeClass(dependsOnMethods = "init")
- public void initData() {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
- AuditedTestEntity ent1 = new AuditedTestEntity(1, "str1");
- NotAuditedTestEntity ent2 = new NotAuditedTestEntity(1, "str1");
-
- em.persist(ent1);
- em.persist(ent2);
- em.getTransaction().commit();
-
- em.getTransaction().begin();
-
- ent1 = em.find(AuditedTestEntity.class, 1);
- ent2 = em.find(NotAuditedTestEntity.class, 1);
- ent1.setStr1("str2");
- ent2.setStr1("str2");
- em.getTransaction().commit();
- }
-
- @Test
- public void testIsEntityClassAuditedForAuditedEntity() {
- assert getAuditReader().isEntityClassAudited(AuditedTestEntity.class);
-
- assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(AuditedTestEntity.class, 1));
- }
-
- @Test
- public void testIsEntityClassAuditedForNotAuditedEntity() {
-
- assert !getAuditReader().isEntityClassAudited(NotAuditedTestEntity.class);
-
- try {
- getAuditReader().getRevisions(NotAuditedTestEntity.class, 1);
- } catch (NotAuditedException nae) {
- // it's ok because the entity is not audited
- assert true;
- }
- }
-
-
-}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,88 @@
+/*
+ * 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.envers.test.integration.auditReader;
+
+import java.util.Arrays;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.envers.exception.NotAuditedException;
+import org.hibernate.envers.test.AbstractEntityTest;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * A test which checks the correct behavior of AuditReader.isEntityClassAudited(Class entityClass).
+ *
+ * @author Hernan Chanfreau
+ */
+public class AuditReaderAPITest extends AbstractEntityTest {
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(AuditedTestEntity.class);
+ cfg.addAnnotatedClass(NotAuditedTestEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+ AuditedTestEntity ent1 = new AuditedTestEntity(1, "str1");
+ NotAuditedTestEntity ent2 = new NotAuditedTestEntity(1, "str1");
+
+ em.persist(ent1);
+ em.persist(ent2);
+ em.getTransaction().commit();
+
+ em.getTransaction().begin();
+
+ ent1 = em.find(AuditedTestEntity.class, 1);
+ ent2 = em.find(NotAuditedTestEntity.class, 1);
+ ent1.setStr1("str2");
+ ent2.setStr1("str2");
+ em.getTransaction().commit();
+ }
+
+ @Test
+ public void testIsEntityClassAuditedForAuditedEntity() {
+ assert getAuditReader().isEntityClassAudited(AuditedTestEntity.class);
+
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(AuditedTestEntity.class, 1));
+ }
+
+ @Test
+ public void testIsEntityClassAuditedForNotAuditedEntity() {
+
+ assert !getAuditReader().isEntityClassAudited(NotAuditedTestEntity.class);
+
+ try {
+ getAuditReader().getRevisions(NotAuditedTestEntity.class, 1);
+ } catch (NotAuditedException nae) {
+ // it's ok because the entity is not audited
+ assert true;
+ }
+ }
+
+
+}
Deleted: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -1,88 +0,0 @@
-/*
- * 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.envers.test.integration.auditReader;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.hibernate.envers.Audited;
-
-/**
- * @author Hernan Chanfreau
- */
-@Entity
-public class AuditedTestEntity {
- @Id
- private Integer id;
-
- @Audited
- private String str1;
-
- public AuditedTestEntity() {
- }
-
- public AuditedTestEntity(String str1) {
- this.str1 = str1;
- }
-
- public AuditedTestEntity(Integer id, String str1) {
- this.id = id;
- this.str1 = str1;
- }
-
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public String getStr1() {
- return str1;
- }
-
- public void setStr1(String str1) {
- this.str1 = str1;
- }
-
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof AuditedTestEntity)) return false;
-
- AuditedTestEntity that = (AuditedTestEntity) o;
-
- if (id != null ? !id.equals(that.id) : that.id != null) return false;
- if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
-
- return true;
- }
-
- public int hashCode() {
- int result;
- result = (id != null ? id.hashCode() : 0);
- result = 31 * result + (str1 != null ? str1.hashCode() : 0);
- return result;
- }
-}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,88 @@
+/*
+ * 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.envers.test.integration.auditReader;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.hibernate.envers.Audited;
+
+/**
+ * @author Hernan Chanfreau
+ */
+@Entity
+public class AuditedTestEntity {
+ @Id
+ private Integer id;
+
+ @Audited
+ private String str1;
+
+ public AuditedTestEntity() {
+ }
+
+ public AuditedTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public AuditedTestEntity(Integer id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof AuditedTestEntity)) return false;
+
+ AuditedTestEntity that = (AuditedTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
Deleted: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -1,85 +0,0 @@
-/*
- * 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.envers.test.integration.auditReader;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-@Entity
-public class NotAuditedTestEntity {
- @Id
- private Integer id;
-
- private String str1;
-
- public NotAuditedTestEntity() {
- }
-
- public NotAuditedTestEntity(String str1) {
- this.str1 = str1;
- }
-
- public NotAuditedTestEntity(Integer id, String str1) {
- this.id = id;
- this.str1 = str1;
- }
-
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public String getStr1() {
- return str1;
- }
-
- public void setStr1(String str1) {
- this.str1 = str1;
- }
-
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof NotAuditedTestEntity)) return false;
-
- NotAuditedTestEntity that = (NotAuditedTestEntity) o;
-
- if (id != null ? !id.equals(that.id) : that.id != null) return false;
- if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
-
- return true;
- }
-
- public int hashCode() {
- int result;
- result = (id != null ? id.hashCode() : 0);
- result = 31 * result + (str1 != null ? str1.hashCode() : 0);
- return result;
- }
-}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,85 @@
+/*
+ * 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.envers.test.integration.auditReader;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class NotAuditedTestEntity {
+ @Id
+ private Integer id;
+
+ private String str1;
+
+ public NotAuditedTestEntity() {
+ }
+
+ public NotAuditedTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public NotAuditedTestEntity(Integer id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof NotAuditedTestEntity)) return false;
+
+ NotAuditedTestEntity that = (NotAuditedTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java 2010-02-10 17:34:16 UTC (rev 18766)
@@ -0,0 +1,83 @@
+/*
+ * 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.envers.test.integration.ids;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.envers.test.AbstractEntityTest;
+import org.hibernate.envers.test.entities.ids.*;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.persistence.EntityManager;
+import java.util.Arrays;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class DateId extends AbstractEntityTest {
+ private Date id1;
+
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(DateIdTestEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+
+ // Revision 1
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+
+ DateIdTestEntity dite = new DateIdTestEntity(new Date(), "x");
+ em.persist(dite);
+
+ id1 = dite.getId();
+
+ em.getTransaction().commit();
+
+ // Revision 2
+ em = getEntityManager();
+ em.getTransaction().begin();
+
+ dite = em.find(DateIdTestEntity.class, id1);
+ dite.setStr1("y");
+
+ em.getTransaction().commit();
+ }
+
+ @Test
+ public void testRevisionsCounts() {
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(DateIdTestEntity.class, id1));
+ }
+
+ @Test
+ public void testHistoryOfId1() {
+ DateIdTestEntity ver1 = new DateIdTestEntity(id1, "x");
+ DateIdTestEntity ver2 = new DateIdTestEntity(id1, "y");
+
+ assert getAuditReader().find(DateIdTestEntity.class, id1, 1).getStr1().equals("x");
+ assert getAuditReader().find(DateIdTestEntity.class, id1, 2).getStr1().equals("y");
+ }
+}
\ No newline at end of file
Modified: core/branches/envers-hibernate-3.3/src/test/resources/testng.xml
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/resources/testng.xml 2010-02-10 16:00:29 UTC (rev 18765)
+++ core/branches/envers-hibernate-3.3/src/test/resources/testng.xml 2010-02-10 17:34:16 UTC (rev 18766)
@@ -4,6 +4,7 @@
<test name="All">
<packages>
<package name="org.hibernate.envers.test.integration.accesstype" />
+ <package name="org.hibernate.envers.test.integration.auditReader" />
<package name="org.hibernate.envers.test.integration.basic" />
<package name="org.hibernate.envers.test.integration.cache" />
<package name="org.hibernate.envers.test.integration.collection" />
@@ -46,7 +47,7 @@
<package name="org.hibernate.envers.test.integration.manytomany.ternary" />
<package name="org.hibernate.envers.test.integration.manytomany.unidirectional" />
<package name="org.hibernate.envers.test.integration.manytoone.unidirectional" />
- <package name="org.hibernate.envers.test.integration.naming" />
+ <package name="org.hibernate.envers.test.integration.naming"/>
<package name="org.hibernate.envers.test.integration.naming.ids" />
<package name="org.hibernate.envers.test.integration.notinsertable" />
<package name="org.hibernate.envers.test.integration.notinsertable.manytoone" />
16 years, 2 months
Hibernate SVN: r18765 - in core/trunk/envers/src/test/java/org/hibernate/envers/test: integration/ids and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2010-02-10 11:00:29 -0500 (Wed, 10 Feb 2010)
New Revision: 18765
Added:
core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java
Log:
HHH-4899:
- test
Copied: core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java (from rev 18762, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/MulIdTestEntity.java)
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java 2010-02-10 16:00:29 UTC (rev 18765)
@@ -0,0 +1,90 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import org.hibernate.envers.Audited;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class DateIdTestEntity {
+ @Id
+ private Date id;
+
+ @Audited
+ private String str1;
+
+ public DateIdTestEntity() {
+ }
+
+ public DateIdTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public DateIdTestEntity(Date id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public Date getId() {
+ return id;
+ }
+
+ public void setId(Date id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ DateIdTestEntity that = (DateIdTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id != null ? id.hashCode() : 0;
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
Copied: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java (from rev 18763, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java)
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java 2010-02-10 16:00:29 UTC (rev 18765)
@@ -0,0 +1,83 @@
+/*
+ * 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.envers.test.integration.ids;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.envers.test.AbstractEntityTest;
+import org.hibernate.envers.test.entities.ids.*;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.persistence.EntityManager;
+import java.util.Arrays;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class DateId extends AbstractEntityTest {
+ private Date id1;
+
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(DateIdTestEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+
+ // Revision 1
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+
+ DateIdTestEntity dite = new DateIdTestEntity(new Date(), "x");
+ em.persist(dite);
+
+ id1 = dite.getId();
+
+ em.getTransaction().commit();
+
+ // Revision 2
+ em = getEntityManager();
+ em.getTransaction().begin();
+
+ dite = em.find(DateIdTestEntity.class, id1);
+ dite.setStr1("y");
+
+ em.getTransaction().commit();
+ }
+
+ @Test
+ public void testRevisionsCounts() {
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(DateIdTestEntity.class, id1));
+ }
+
+ @Test
+ public void testHistoryOfId1() {
+ DateIdTestEntity ver1 = new DateIdTestEntity(id1, "x");
+ DateIdTestEntity ver2 = new DateIdTestEntity(id1, "y");
+
+ assert getAuditReader().find(DateIdTestEntity.class, id1, 1).getStr1().equals("x");
+ assert getAuditReader().find(DateIdTestEntity.class, id1, 2).getStr1().equals("y");
+ }
+}
\ No newline at end of file
16 years, 2 months
Hibernate SVN: r18764 - in core/trunk/envers/src: main/java/org/hibernate/envers/reader and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2010-02-10 10:38:27 -0500 (Wed, 10 Feb 2010)
New Revision: 18764
Added:
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/AuditReader.java
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java
core/trunk/envers/src/test/resources/testng.xml
Log:
HHH-4731:
- a simple API to check if an entity is audited or not
- applying patch by Hern?\195?\161n Chanfreau - thanks!
Modified: core/trunk/envers/src/main/java/org/hibernate/envers/AuditReader.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/AuditReader.java 2010-02-10 15:30:48 UTC (rev 18763)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/AuditReader.java 2010-02-10 15:38:27 UTC (rev 18764)
@@ -32,6 +32,7 @@
/**
* @author Adam Warski (adam at warski dot org)
+ * @author Hernan Chanfreau
*/
public interface AuditReader {
/**
@@ -121,4 +122,12 @@
* is closed.
*/
AuditQueryCreator createQuery();
+
+ /**
+ * Checks if the entityClass was configured to be audited.
+ *
+ * @param entityClass Class of the entity asking for audit support
+ * @return true if the entityClass is audited.
+ */
+ boolean isEntityClassAudited(Class<?> entityClass);
}
Modified: core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java 2010-02-10 15:30:48 UTC (rev 18763)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java 2010-02-10 15:38:27 UTC (rev 18764)
@@ -45,6 +45,7 @@
/**
* @author Adam Warski (adam at warski dot org)
+ * @author Hernan Chanfreau
*/
public class AuditReaderImpl implements AuditReaderImplementor {
private final AuditConfiguration verCfg;
@@ -209,4 +210,12 @@
public AuditQueryCreator createQuery() {
return new AuditQueryCreator(verCfg, this);
}
+
+ public boolean isEntityClassAudited(Class<?> entityClass) {
+ checkNotNull(entityClass, "Entity class");
+ checkSession();
+
+ String entityName = entityClass.getName();
+ return (verCfg.getEntCfg().isVersioned(entityName));
+ }
}
Added: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditReaderAPITest.java 2010-02-10 15:38:27 UTC (rev 18764)
@@ -0,0 +1,88 @@
+/*
+ * 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.envers.test.integration.auditReader;
+
+import java.util.Arrays;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.envers.exception.NotAuditedException;
+import org.hibernate.envers.test.AbstractEntityTest;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * A test which checks the correct behavior of AuditReader.isEntityClassAudited(Class entityClass).
+ *
+ * @author Hernan Chanfreau
+ */
+public class AuditReaderAPITest extends AbstractEntityTest {
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(AuditedTestEntity.class);
+ cfg.addAnnotatedClass(NotAuditedTestEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+ AuditedTestEntity ent1 = new AuditedTestEntity(1, "str1");
+ NotAuditedTestEntity ent2 = new NotAuditedTestEntity(1, "str1");
+
+ em.persist(ent1);
+ em.persist(ent2);
+ em.getTransaction().commit();
+
+ em.getTransaction().begin();
+
+ ent1 = em.find(AuditedTestEntity.class, 1);
+ ent2 = em.find(NotAuditedTestEntity.class, 1);
+ ent1.setStr1("str2");
+ ent2.setStr1("str2");
+ em.getTransaction().commit();
+ }
+
+ @Test
+ public void testIsEntityClassAuditedForAuditedEntity() {
+ assert getAuditReader().isEntityClassAudited(AuditedTestEntity.class);
+
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(AuditedTestEntity.class, 1));
+ }
+
+ @Test
+ public void testIsEntityClassAuditedForNotAuditedEntity() {
+
+ assert !getAuditReader().isEntityClassAudited(NotAuditedTestEntity.class);
+
+ try {
+ getAuditReader().getRevisions(NotAuditedTestEntity.class, 1);
+ } catch (NotAuditedException nae) {
+ // it's ok because the entity is not audited
+ assert true;
+ }
+ }
+
+
+}
Added: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/AuditedTestEntity.java 2010-02-10 15:38:27 UTC (rev 18764)
@@ -0,0 +1,88 @@
+/*
+ * 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.envers.test.integration.auditReader;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.hibernate.envers.Audited;
+
+/**
+ * @author Hernan Chanfreau
+ */
+@Entity
+public class AuditedTestEntity {
+ @Id
+ private Integer id;
+
+ @Audited
+ private String str1;
+
+ public AuditedTestEntity() {
+ }
+
+ public AuditedTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public AuditedTestEntity(Integer id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof AuditedTestEntity)) return false;
+
+ AuditedTestEntity that = (AuditedTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
Added: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/auditReader/NotAuditedTestEntity.java 2010-02-10 15:38:27 UTC (rev 18764)
@@ -0,0 +1,85 @@
+/*
+ * 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.envers.test.integration.auditReader;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class NotAuditedTestEntity {
+ @Id
+ private Integer id;
+
+ private String str1;
+
+ public NotAuditedTestEntity() {
+ }
+
+ public NotAuditedTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public NotAuditedTestEntity(Integer id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof NotAuditedTestEntity)) return false;
+
+ NotAuditedTestEntity that = (NotAuditedTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
Modified: core/trunk/envers/src/test/resources/testng.xml
===================================================================
--- core/trunk/envers/src/test/resources/testng.xml 2010-02-10 15:30:48 UTC (rev 18763)
+++ core/trunk/envers/src/test/resources/testng.xml 2010-02-10 15:38:27 UTC (rev 18764)
@@ -4,6 +4,7 @@
<test name="All">
<packages>
<package name="org.hibernate.envers.test.integration.accesstype" />
+ <package name="org.hibernate.envers.test.integration.auditReader" />
<package name="org.hibernate.envers.test.integration.basic" />
<package name="org.hibernate.envers.test.integration.cache" />
<package name="org.hibernate.envers.test.integration.collection" />
16 years, 2 months
Hibernate SVN: r18763 - in core/trunk/envers/src: test/java/org/hibernate/envers/test/entities/ids and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2010-02-10 10:30:48 -0500 (Wed, 10 Feb 2010)
New Revision: 18763
Added:
core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java
Log:
HHH-4792:
- fixing the way properties are checked to be mutable
- applying patch to Slawek Garwol - thanks!
Modified: core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-10 14:35:07 UTC (rev 18762)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-10 15:30:48 UTC (rev 18763)
@@ -42,7 +42,6 @@
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.type.ImmutableType;
import org.hibernate.type.Type;
/**
@@ -62,7 +61,7 @@
Property property = properties.next();
Type propertyType = property.getType();
if (!"_identifierMapper".equals(property.getName())) {
- if (propertyType instanceof ImmutableType) {
+ if (!propertyType.isMutable()) {
// Last but one parameter: ids are always insertable
mainGenerator.getBasicMetadataGenerator().addBasic(parent,
getIdPersistentPropertyAuditingData(property),
Added: core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnum.java 2010-02-10 15:30:48 UTC (rev 18763)
@@ -0,0 +1,40 @@
+/*
+ * 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.envers.test.entities.ids;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+public enum CustomEnum {
+ YES,
+ NO;
+
+ public String toYesNo() {
+ return this == YES ? "Y" : "N";
+ }
+
+ public static CustomEnum fromYesNo(String value) {
+ return "Y".equals(value) ? YES : NO;
+ }
+}
Added: core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CustomEnumUserType.java 2010-02-10 15:30:48 UTC (rev 18763)
@@ -0,0 +1,99 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import java.io.Serializable;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.hibernate.HibernateException;
+import org.hibernate.usertype.UserType;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+public class CustomEnumUserType implements UserType {
+ private static final int[] SQL_TYPES = {Types.VARCHAR};
+
+ public int[] sqlTypes() {
+ return SQL_TYPES;
+ }
+
+ public Class returnedClass() {
+ return CustomEnum.class;
+ }
+
+ public boolean equals(Object x, Object y) throws HibernateException {
+ if (x == y) {
+ return true;
+ }
+ if ((x == null) || (y == null)) {
+ return false;
+ }
+ return x.equals(y);
+ }
+
+ public int hashCode(Object x) throws HibernateException {
+ return (x == null) ? 0 : x.hashCode();
+ }
+
+ public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
+ String name = rs.getString(names[0]);
+ if (rs.wasNull()) {
+ return null;
+ }
+ return CustomEnum.fromYesNo(name);
+ }
+
+ public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
+ CustomEnum val = (CustomEnum) value;
+ if (val == null) {
+ st.setNull(index, Types.VARCHAR);
+ } else {
+ st.setString(index, val.toYesNo());
+ }
+ }
+
+ public Object deepCopy(Object value) throws HibernateException {
+ return value;
+ }
+
+ public boolean isMutable() {
+ return false;
+ }
+
+ public Serializable disassemble(Object value) throws HibernateException {
+ return (Serializable) value;
+ }
+
+ public Object assemble(Serializable cached, Object owner) throws HibernateException {
+ return cached;
+ }
+
+ public Object replace(Object original, Object target, Object owner) throws HibernateException {
+ return original;
+ }
+}
Added: core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomType.java 2010-02-10 15:30:48 UTC (rev 18763)
@@ -0,0 +1,87 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import java.io.Serializable;
+import javax.persistence.Embeddable;
+
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+@Embeddable
+@TypeDef(name = "customEnum", typeClass = CustomEnumUserType.class)
+public class EmbIdWithCustomType implements Serializable {
+ private Integer x;
+
+ @Type(type = "customEnum")
+ private CustomEnum customEnum;
+
+ public EmbIdWithCustomType() {
+ }
+
+ public EmbIdWithCustomType(Integer x, CustomEnum customEnum) {
+ this.x = x;
+ this.customEnum = customEnum;
+ }
+
+ public Integer getX() {
+ return x;
+ }
+
+ public void setX(Integer x) {
+ this.x = x;
+ }
+
+ public CustomEnum getCustomEnum() {
+ return customEnum;
+ }
+
+ public void setCustomEnum(CustomEnum customEnum) {
+ this.customEnum = customEnum;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!(obj instanceof EmbIdWithCustomType)) return false;
+
+ EmbIdWithCustomType that = (EmbIdWithCustomType) obj;
+
+ if (x != null ? !x.equals(that.x) : that.x != null) return false;
+ if (customEnum != that.customEnum) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result;
+ result = (x != null ? x.hashCode() : 0);
+ result = 31 * result + (customEnum != null ? customEnum.hashCode() : 0);
+ return result;
+ }
+}
Added: core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbIdWithCustomTypeTestEntity.java 2010-02-10 15:30:48 UTC (rev 18763)
@@ -0,0 +1,83 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+
+import org.hibernate.envers.Audited;
+
+/**
+ * @author Slawek Garwol (slawekgarwol at gmail dot com)
+ */
+@Entity
+public class EmbIdWithCustomTypeTestEntity {
+ @EmbeddedId
+ private EmbIdWithCustomType id;
+
+ @Audited
+ private String str1;
+
+ public EmbIdWithCustomTypeTestEntity() {
+ }
+
+ public EmbIdWithCustomTypeTestEntity(EmbIdWithCustomType id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public EmbIdWithCustomType getId() {
+ return id;
+ }
+
+ public void setId(EmbIdWithCustomType id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!(obj instanceof EmbIdWithCustomTypeTestEntity)) return false;
+
+ EmbIdWithCustomTypeTestEntity that = (EmbIdWithCustomTypeTestEntity) obj;
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
Modified: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java 2010-02-10 14:35:07 UTC (rev 18762)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeIds.java 2010-02-10 15:30:48 UTC (rev 18763)
@@ -27,10 +27,7 @@
import javax.persistence.EntityManager;
import org.hibernate.envers.test.AbstractEntityTest;
-import org.hibernate.envers.test.entities.ids.EmbId;
-import org.hibernate.envers.test.entities.ids.EmbIdTestEntity;
-import org.hibernate.envers.test.entities.ids.MulId;
-import org.hibernate.envers.test.entities.ids.MulIdTestEntity;
+import org.hibernate.envers.test.entities.ids.*;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -44,10 +41,13 @@
private EmbId id2;
private MulId id3;
private MulId id4;
+ private EmbIdWithCustomType id5;
+ private EmbIdWithCustomType id6;
public void configure(Ejb3Configuration cfg) {
cfg.addAnnotatedClass(EmbIdTestEntity.class);
cfg.addAnnotatedClass(MulIdTestEntity.class);
+ cfg.addAnnotatedClass(EmbIdWithCustomTypeTestEntity.class);
}
@BeforeClass(dependsOnMethods = "init")
@@ -56,6 +56,8 @@
id2 = new EmbId(10, 20);
id3 = new MulId(100, 101);
id4 = new MulId(102, 103);
+ id5 = new EmbIdWithCustomType(25, CustomEnum.NO);
+ id6 = new EmbIdWithCustomType(27, CustomEnum.YES);
// Revision 1
EntityManager em = getEntityManager();
@@ -63,6 +65,7 @@
em.persist(new EmbIdTestEntity(id1, "x"));
em.persist(new MulIdTestEntity(id3.getId1(), id3.getId2(), "a"));
+ em.persist(new EmbIdWithCustomTypeTestEntity(id5, "c"));
em.getTransaction().commit();
@@ -72,6 +75,7 @@
em.persist(new EmbIdTestEntity(id2, "y"));
em.persist(new MulIdTestEntity(id4.getId1(), id4.getId2(), "b"));
+ em.persist(new EmbIdWithCustomTypeTestEntity(id6, "d"));
em.getTransaction().commit();
@@ -83,11 +87,15 @@
EmbIdTestEntity ete2 = em.find(EmbIdTestEntity.class, id2);
MulIdTestEntity mte3 = em.find(MulIdTestEntity.class, id3);
MulIdTestEntity mte4 = em.find(MulIdTestEntity.class, id4);
+ EmbIdWithCustomTypeTestEntity cte5 = em.find(EmbIdWithCustomTypeTestEntity.class, id5);
+ EmbIdWithCustomTypeTestEntity cte6 = em.find(EmbIdWithCustomTypeTestEntity.class, id6);
ete1.setStr1("x2");
ete2.setStr1("y2");
mte3.setStr1("a2");
mte4.setStr1("b2");
+ cte5.setStr1("c2");
+ cte6.setStr1("d2");
em.getTransaction().commit();
@@ -98,11 +106,15 @@
ete1 = em.find(EmbIdTestEntity.class, id1);
ete2 = em.find(EmbIdTestEntity.class, id2);
mte3 = em.find(MulIdTestEntity.class, id3);
+ cte5 = em.find(EmbIdWithCustomTypeTestEntity.class, id5);
+ cte6 = em.find(EmbIdWithCustomTypeTestEntity.class, id6);
em.remove(ete1);
em.remove(mte3);
+ em.remove(cte6);
ete2.setStr1("y3");
+ cte5.setStr1("c3");
em.getTransaction().commit();
@@ -126,6 +138,10 @@
assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(MulIdTestEntity.class, id3));
assert Arrays.asList(2, 3).equals(getAuditReader().getRevisions(MulIdTestEntity.class, id4));
+
+ assert Arrays.asList(1, 3, 4).equals(getAuditReader().getRevisions(EmbIdWithCustomTypeTestEntity.class, id5));
+
+ assert Arrays.asList(2, 3, 4).equals(getAuditReader().getRevisions(EmbIdWithCustomTypeTestEntity.class, id6));
}
@Test
@@ -176,4 +192,29 @@
assert getAuditReader().find(MulIdTestEntity.class, id4, 4).equals(ver2);
assert getAuditReader().find(MulIdTestEntity.class, id4, 5).equals(ver2);
}
+
+ @Test
+ public void testHistoryOfId5() {
+ EmbIdWithCustomTypeTestEntity ver1 = new EmbIdWithCustomTypeTestEntity(id5, "c");
+ EmbIdWithCustomTypeTestEntity ver2 = new EmbIdWithCustomTypeTestEntity(id5, "c2");
+ EmbIdWithCustomTypeTestEntity ver3 = new EmbIdWithCustomTypeTestEntity(id5, "c3");
+
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id5, 1).equals(ver1);
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id5, 2).equals(ver1);
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id5, 3).equals(ver2);
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id5, 4).equals(ver3);
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id5, 5).equals(ver3);
+ }
+
+ @Test
+ public void testHistoryOfId6() {
+ EmbIdWithCustomTypeTestEntity ver1 = new EmbIdWithCustomTypeTestEntity(id6, "d");
+ EmbIdWithCustomTypeTestEntity ver2 = new EmbIdWithCustomTypeTestEntity(id6, "d2");
+
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id6, 1) == null;
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id6, 2).equals(ver1);
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id6, 3).equals(ver2);
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id6, 4) == null;
+ assert getAuditReader().find(EmbIdWithCustomTypeTestEntity.class, id6, 5) == null;
+ }
}
16 years, 2 months
Hibernate SVN: r18762 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2.
by hibernate-commits@lists.jboss.org
Author: stalep
Date: 2010-02-10 09:35:07 -0500 (Wed, 10 Feb 2010)
New Revision: 18762
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java
Log:
[HHH-4889]
exending the test to try to replicate an error in the specj benchmark
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java 2010-02-10 08:07:10 UTC (rev 18761)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java 2010-02-10 14:35:07 UTC (rev 18762)
@@ -30,6 +30,8 @@
import org.hibernate.Transaction;
import org.hibernate.test.annotations.TestCase;
+import org.hibernate.junit.FailureExpected;
+
/**
* A test.
*
@@ -42,10 +44,18 @@
Transaction tx = s.beginTransaction();
Customer c1 = new Customer(
- "foo", "bar", "contact1", "100", new BigDecimal( 1000 ), new BigDecimal( 1000 ), new BigDecimal( 1000 )
- );
-
+ "foo", "bar", "contact1", "100", new BigDecimal( 1000 ), new BigDecimal( 1000 ), new BigDecimal( 1000 ));
s.persist( c1 );
+ s.flush();
+ s.clear();
+
+// why does this cause a failure?
+// Customer c2 = new Customer(
+// "foo1", "bar1", "contact2", "200", new BigDecimal( 2000 ), new BigDecimal( 2000 ), new BigDecimal( 2000 ));
+// s.persist( c2 );
+// s.flush();
+// s.clear();
+
Item boat = new Item();
boat.setId( "1" );
boat.setName( "cruiser" );
@@ -62,9 +72,9 @@
s.flush();
s.clear();
- Customer c2 = ( Customer ) s.createQuery( "select c from Customer c" ).uniqueResult();
+ Customer c12 = ( Customer ) s.createQuery( "select c from Customer c" ).uniqueResult();
- List<CustomerInventory> inventory = c2.getInventories();
+ List<CustomerInventory> inventory = c12.getInventories();
assertEquals( 1, inventory.size() );
assertEquals( 10, inventory.get( 0 ).getQuantity() );
@@ -74,7 +84,46 @@
assertTrue( true );
}
+
+ /*
+ public void testCustomer()
+ {
+ Session s = openSession();
+ Transaction tx = s.beginTransaction();
+ for(int i=0; i < 2; i++)
+ {
+ Customer c1 = new Customer(
+ "foo"+i, "bar"+i, "contact"+i, "100", new BigDecimal( 1000+i ), new BigDecimal( 1000+i ), new BigDecimal( 1000+i )
+ );
+ s.persist( c1 );
+ s.flush();
+ s.clear();
+
+ Item boat = new Item();
+ boat.setId( Integer.toString(i) );
+ boat.setName( "cruiser" );
+ boat.setPrice( new BigDecimal( 500 ) );
+ boat.setDescription( "a boat" );
+ boat.setCategory( 42 );
+ s.persist( boat );
+ s.flush();
+ s.clear();
+
+ c1.addInventory( boat, 10, new BigDecimal( 5000 ) );
+ s.merge( c1 );
+
+ s.flush();
+ s.clear();
+ }
+
+ tx.rollback();
+ s.close();
+
+ assertTrue( true );
+
+ }*/
+
protected Class[] getAnnotatedClasses() {
return new Class[] {
Customer.class,
16 years, 2 months
Hibernate SVN: r18761 - core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content.
by hibernate-commits@lists.jboss.org
Author: rwilding
Date: 2010-02-10 03:07:10 -0500 (Wed, 10 Feb 2010)
New Revision: 18761
Modified:
core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml
core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/configuration.xml
Log:
'deleted commented-out programlisting tags that were causing lang transform problems'
Modified: core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml
===================================================================
--- core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml 2010-02-10 07:05:33 UTC (rev 18760)
+++ core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml 2010-02-10 08:07:10 UTC (rev 18761)
@@ -50,7 +50,7 @@
Here is an example mapping:
</para>
- <!-- <programlisting id="mapping-declaration-ex1" revision="1"> -->
+
<programlisting><![CDATA[<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
Modified: core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/configuration.xml
===================================================================
--- core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/configuration.xml 2010-02-10 07:05:33 UTC (rev 18760)
+++ core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/configuration.xml 2010-02-10 08:07:10 UTC (rev 18761)
@@ -251,7 +251,7 @@
The following is an example <filename>hibernate.properties</filename> file for c3p0:
</para>
- <!-- <programlisting id="c3p0-configuration" revision="1"> -->
+
<programlisting><![CDATA[hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://localhost/mydatabase
hibernate.connection.username = myuser
16 years, 2 months