Skip to content

Commit a0c7202

Browse files
committed
Update Hibernate support to latest version of 7.x line. Closes #346.
1 parent c007b4f commit a0c7202

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@
10981098
<version.org.codehaus.jettison>1.5.4</version.org.codehaus.jettison>
10991099
<version.com.fasterxml.woodstox.core>6.4.0</version.com.fasterxml.woodstox.core>
11001100
<version.org.dom4j>2.0.2</version.org.dom4j>
1101-
<version.org.hibernate.orm.core>6.6.28.Final</version.org.hibernate.orm.core>
1101+
<version.org.hibernate.orm.core>7.1.0.Final</version.org.hibernate.orm.core>
11021102
<version.org.hibernate.orm.envers>${version.org.hibernate.orm.core}</version.org.hibernate.orm.envers>
11031103
<version.org.jdom>1.1.3</version.org.jdom>
11041104
<version.org.jdom2>2.0.6</version.org.jdom2>

xstream-distribution/src/content/changes.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ <h2>Minor changes</h2>
127127

128128
<ul>
129129
<li>GHI:#347: PrettyPrintWriter exposes internal classes of com.thoughtworks.xstream.core.util.</li>
130+
<li>GHPR:#346: XStream supports now Hibernate from 3.x up to current version 7.1.0.</li>
130131
</ul>
131132

132133
<h2>API changes</h2>

xstream-hibernate/pom.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<packaging>jar</packaging>
2020
<name>XStream Hibernate Extension</name>
2121
<description>
22-
XStream extension for Hibernate 4 to untie Java objects from Hibernate.
22+
XStream extension for Hibernate to untie Java objects from Hibernate.
2323
</description>
2424

2525
<profiles>
@@ -37,6 +37,15 @@
3737
</plugins>
3838
</build>
3939
</profile>
40+
<profile>
41+
<id>jdk16-le</id>
42+
<activation>
43+
<jdk>(,17)</jdk>
44+
</activation>
45+
<properties>
46+
<version.org.hibernate.orm.core>6.6.28.Final</version.org.hibernate.orm.core>
47+
</properties>
48+
</profile>
4049
</profiles>
4150

4251
<build>
@@ -117,7 +126,7 @@
117126
</dependencies>
118127

119128
<properties>
120-
<bundle.version.hibernate>[3,7)</bundle.version.hibernate>
129+
<bundle.version.hibernate>[3,8)</bundle.version.hibernate>
121130
<bundle.export.package>!com.thoughtworks.xstream.hibernate.util,com.thoughtworks.xstream.hibernate.*;-noimport:=true</bundle.export.package>
122131
<jar.module.name>xstream.hibernate</jar.module.name>
123132
<surefire.argline>--add-opens java.base/java.lang=ALL-UNNAMED</surefire.argline>

xstream-hibernate/src/test/acceptance/hibernate/HibernateReferenceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2011, 2012, 2018 XStream Committers.
2+
* Copyright (C) 2011, 2012, 2018, 2025 XStream Committers.
33
* All rights reserved.
44
*
55
* The software in this package is published under the terms of the BSD
@@ -44,7 +44,7 @@ protected void tearDown() {
4444
final Session session = getSessionFactory().getCurrentSession();
4545
session.beginTransaction();
4646
final Division div = (Division)session.createQuery("from Division").uniqueResult();
47-
session.delete(div);
47+
session.remove(div);
4848
session.getTransaction().commit();
4949
} catch (final RuntimeException e) {
5050
e.printStackTrace();
@@ -119,9 +119,9 @@ private Division setupPersistentDivision() {
119119
/* This save is necessitated by the fact that Hibernate's transitive persistence is depth-first and does not do
120120
* a full graph analysis. Therefore it would be possible for Hibernate to try to save the person record before
121121
* the site record, which would throw an error if the person.site FK is non-nullable. */
122-
session.save(site);
122+
session.persist(site);
123123
new Person("Tom", dep, site);
124-
session.save(div);
124+
session.persist(div);
125125
session.flush();
126126
session.getTransaction().commit();
127127
return div;

0 commit comments

Comments
 (0)