[hibernate-dev] Removing dom4j?

Chris Cranford chris at hibernate.org
Wed Feb 21 10:52:57 EST 2018


See inline

On 02/20/2018 10:52 AM, Jordan Gigov wrote:
> Well, it took longer than expected as the source of the failures
> became more obscure, but here it is, done on the master (5.3) branch.
>
> https://github.com/coladict/hibernate-orm/tree/dom4j-removal
> It's in the dom4j-removal branch.
>
> The tests for entity-mode dom4j have been removed, but it might be a
> better idea to write new ones that expect an error.
> Also the hibernate-mapping-4.0.xsd schema hasn't been valid since
> dom4j entity-mode was removed in 2011
> (4a4f636caf9ecc62fe0d230f422ad3eab2517db0) but I haven't touched it.
>
> You could wait for 6.0, but there is time to review this for 5.3.
>
The biggest difference between what you did and my own for Envers is
that I decided to use the JAXB binding classes directly rather than
replace dom4j with another XML abstraction.  Using JAXB binding classes
directly gives several noticeable benefits:

 * Better maintainability - cleaner and easier to read code
 * Better performance - less in-memory string manipulation and cloning
 * Most important - compile-time schema compliance.

The replacement of dom4j with the w3c equivalents is likely fine for
5.3; however, the long-term goal is to do away with the XML manipulation
all together in Envers.

> I have only passed a `clean build` using JDK8 and the default H2
> database. Maybe other databases could expose errors, but it's highly
> unlikely.
> JDK9 is a bit more likely to expose an incompatibility.
>
> On 19 February 2018 at 17:03, Chris Cranford <chris at hibernate.org
> <mailto:chris at hibernate.org>> wrote:
>
>     See below
>
>     On 02/18/2018 11:38 AM, Steve Ebersole wrote:
>     > On Sun, Feb 18, 2018 at 4:52 AM Jordan Gigov <coladict at gmail.com
>     <mailto:coladict at gmail.com>> wrote:
>     >
>     >> I think transitioning to automatic bindings via JAXB will
>     result in error
>     >> messages on wrong configurations becoming far too vague to be
>     useful to the
>     >> users.
>     >>
>     > I'm not understanding... we've used jaxb since 4.0
>     >
>     > I am just talking about envers and how it integrates with
>     hibernate-core.
>     > At the moment it directly uses dom4j - we'd like to eventualy
>     have it use
>     > the jaxb model instead
>
>     There is a JIRA [1] that specifically targets this work from an Envers
>     perspective. 
>
>     I have a working implementation based on Hibernate 5.x but this is
>     planned to be integrated in Hibernate 6.  I'd expect to see this get
>     integrated once we get a bit more development finalized around
>     Hibernate
>     Core in 6.
>
>     [1]: https://hibernate.atlassian.net/browse/HHH-11483
>     <https://hibernate.atlassian.net/browse/HHH-11483>
>
>     Thanks,
>     Chris
>
>



More information about the hibernate-dev mailing list