From 095eef2dcbcab9d748d4166c4cf6da6d567b79d4 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Thu, 19 Nov 2020 11:18:34 +0100 Subject: [PATCH 1/8] HHH-14335 Remember the resolved type in SimpleValue#getType instead of resolving multiple times --- .../src/main/java/org/hibernate/mapping/SimpleValue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java b/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java index 3db302a5d4..b1c9790f24 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java @@ -499,7 +499,7 @@ public class SimpleValue implements KeyValue { throw new MappingException( msg ); } - return result; + return type = result; } @Override From 97b67603acf968038c04fe719886a913fec3ee40 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Wed, 18 Nov 2020 09:53:13 +0800 Subject: [PATCH 2/8] HHH-14334 Make dom4j jaxb-api optional as possible dependency dom4j and jaxb-api is optional if xml mapping disabled continuation of HHH-13204 --- .../model/process/spi/MetadataBuildingProcess.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java index edfba758a4..8221eff0b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java @@ -32,8 +32,11 @@ import org.hibernate.boot.spi.BootstrapContext; import org.hibernate.boot.spi.MetadataBuildingOptions; import org.hibernate.boot.spi.MetadataContributor; import org.hibernate.boot.spi.MetadataImplementor; +import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.MetadataSourceType; import org.hibernate.dialect.Dialect; +import org.hibernate.engine.config.spi.ConfigurationService; +import org.hibernate.engine.config.spi.StandardConverters; import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.type.BasicType; import org.hibernate.type.BasicTypeRegistry; @@ -95,10 +98,16 @@ public class MetadataBuildingProcess { final MetadataSources sources, final BootstrapContext bootstrapContext) { final ManagedResourcesImpl managedResources = ManagedResourcesImpl.baseline( sources, bootstrapContext ); + final ConfigurationService configService = bootstrapContext.getServiceRegistry().getService( ConfigurationService.class ); + final boolean xmlMappingEnabled = configService.getSetting( + AvailableSettings.XML_MAPPING_ENABLED, + StandardConverters.BOOLEAN, + true + ); ScanningCoordinator.INSTANCE.coordinateScan( managedResources, bootstrapContext, - sources.getXmlMappingBinderAccess() + xmlMappingEnabled ? sources.getXmlMappingBinderAccess() : null ); return managedResources; } @@ -290,7 +299,7 @@ public class MetadataBuildingProcess { final EntityHierarchyBuilder hierarchyBuilder = new EntityHierarchyBuilder(); // final MappingBinder mappingBinder = new MappingBinder( true ); // We need to disable validation here. It seems Envers is not producing valid (according to schema) XML - final MappingBinder mappingBinder = new MappingBinder( classLoaderService, false ); + final MappingBinder mappingBinder = options.isXmlMappingEnabled() ? new MappingBinder( classLoaderService, false ) : null; for ( AdditionalJaxbMappingProducer producer : producers ) { log.tracef( "Calling AdditionalJaxbMappingProducer : %s", producer ); Collection additionalMappings = producer.produceAdditionalMappings( From 966d07c2d1ed18f0cfe15ef635e7df470dfe0581 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Tue, 10 Nov 2020 15:47:07 +0100 Subject: [PATCH 3/8] HHH-14319 Test case showing CollectionType.replaceElements wrongly clears backing collection --- .../UpdateDetachedTest.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java index 94087954d8..e08719b4d1 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java @@ -6,6 +6,10 @@ */ package org.hibernate.test.annotations.selectbeforeupdate; +import java.util.HashSet; +import java.util.Set; +import javax.persistence.ElementCollection; +import javax.persistence.Embeddable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; @@ -136,6 +140,37 @@ public class UpdateDetachedTest extends BaseCoreFunctionalTestCase{ assertEquals( Integer.valueOf( 1 ), foo.getVersion() ); } + @Test + @TestForIssue(jiraKey = "HHH-14319") + public void testUpdateDetachedWithAttachedPersistentSet() { + final Bar bar = new Bar( 4, "Bar" ); + final Set comments = new HashSet<>(); + comments.add( new Comment( "abc", "me" ) ); + bar.comments = comments; + + // this should generate versions + TransactionUtil.doInHibernate( this::sessionFactory, session -> { + session.save( bar ); + } ); + final Bar loadedBar = TransactionUtil.doInHibernate( this::sessionFactory, session -> { + // We set the comments to the hash set and leave it "dirty" + Bar b = session.find( Bar.class, bar.getId() ); + b.comments = comments; + + // During flushing, the comments HashSet becomes the backing collection of new PersistentSet which replaces the old entry + session.flush(); + + // Replace the persistent collection with the backing collection in the field + b.comments = comments; + + // It's vital that we try merging a detached instance + session.detach( b ); + return (Bar) session.merge( b ); + } ); + + assertEquals( 1, loadedBar.comments.size() ); + } + @Entity(name = "Foo") @SelectBeforeUpdate public static class Foo { @@ -198,6 +233,8 @@ public class UpdateDetachedTest extends BaseCoreFunctionalTestCase{ private String name; @Version private Integer version; + @ElementCollection + private Set comments; Bar() { @@ -231,5 +268,43 @@ public class UpdateDetachedTest extends BaseCoreFunctionalTestCase{ public void setVersion(Integer version) { this.version = version; } + + public Set getComments() { + return comments; + } + + public void setComments(Set comments) { + this.comments = comments; + } + } + + @Embeddable + public static class Comment { + private String comment; + private String author; + + public Comment() { + } + + public Comment(String comment, String author) { + this.comment = comment; + this.author = author; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } } } From a975fbf5d40dce7b8c4778d3cc2baa1b2872fe87 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Tue, 10 Nov 2020 15:48:34 +0100 Subject: [PATCH 4/8] HHH-14319 Create new collection rather than clearing original which is backing PersistentCollection entry of session --- .../src/main/java/org/hibernate/type/CollectionType.java | 3 ++- .../annotations/selectbeforeupdate/UpdateDetachedTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java b/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java index 18d3bdd342..1f4ac97ab3 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CollectionType.java @@ -742,7 +742,8 @@ public abstract class CollectionType extends AbstractType implements Association // need to put the merged elements in a new collection Object result = ( target == null || target == original || - target == LazyPropertyInitializer.UNFETCHED_PROPERTY ) ? + target == LazyPropertyInitializer.UNFETCHED_PROPERTY || + target instanceof PersistentCollection && ( (PersistentCollection) target ).isWrapper( original ) ) ? instantiateResult( original ) : target; //for arrays, replaceElements() may return a different reference, since diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java index e08719b4d1..673607968f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/selectbeforeupdate/UpdateDetachedTest.java @@ -143,7 +143,7 @@ public class UpdateDetachedTest extends BaseCoreFunctionalTestCase{ @Test @TestForIssue(jiraKey = "HHH-14319") public void testUpdateDetachedWithAttachedPersistentSet() { - final Bar bar = new Bar( 4, "Bar" ); + final Bar bar = new Bar( 5, "Bar" ); final Set comments = new HashSet<>(); comments.add( new Comment( "abc", "me" ) ); bar.comments = comments; From 2228bd238e4ed52bf8bc2c239c5c691b0b26aa96 Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Wed, 4 Nov 2020 17:33:03 +0800 Subject: [PATCH 5/8] HHH-13945: fallback to call map if exception thrown --- .../entities/mapper/relation/ToOneIdMapper.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java b/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java index 8246d3aab7..91728d6d25 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java @@ -21,6 +21,8 @@ import org.hibernate.envers.internal.tools.query.Parameters; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.proxy.HibernateProxy; +import javax.persistence.PersistenceException; + /** * @author Adam Warski (adam at warski dot org) * @author HernпїЅn Chanfreau @@ -58,8 +60,16 @@ public class ToOneIdMapper extends AbstractToOneMapper { // bi-directional relation, we always store the "old", unchanged data, to prevent storing changes made // to this field. It is the responsibility of the collection to properly update it if it really changed. Object entity = nonInsertableFake ? oldObj : newObj; + + // fix HHH-13760 - try to aggressively un-proxy this entity to help get the correct type of data later + // in mapToMapFromEntity. But it might fail while getImplementation() if object is deleted or other reasons. + // We catch the exception and fallback to call mapToMapFromEntity directly with the HibernateProxy entity if ( lazyMapping && entity instanceof HibernateProxy ) { - entity = ( (HibernateProxy) entity ).getHibernateLazyInitializer().getImplementation(); + try { + entity = ((HibernateProxy) entity).getHibernateLazyInitializer().getImplementation(); + } catch ( PersistenceException e ) { + // Ignore the exception and fallback to call mapToMapFromEntity directly + } } delegate.mapToMapFromEntity( newData, entity ); From 2404ff56abe4b85008b18d65e3097fb2d6e7de9d Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Tue, 17 Nov 2020 14:48:24 +0800 Subject: [PATCH 6/8] HHH-13945: catch PersistenceException during envers unproxy the field value, and fallback to using proxy entity --- .../integration/manytoone/lazy/ChildUser.java | 38 ++++++++ .../lazy/ManyToOneLazyDeleteTest.java | 88 +++++++++++++++++++ .../integration/manytoone/lazy/Shipment.java | 9 ++ .../test/integration/manytoone/lazy/User.java | 43 +++++++++ 4 files changed, 178 insertions(+) create mode 100644 hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ChildUser.java create mode 100644 hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyDeleteTest.java create mode 100644 hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ChildUser.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ChildUser.java new file mode 100644 index 0000000000..0d97ec57f1 --- /dev/null +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ChildUser.java @@ -0,0 +1,38 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.envers.test.integration.manytoone.lazy; + +import org.hibernate.envers.NotAudited; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import java.util.List; + +/** + * @author Luke Chen + */ +@Entity +@Table(name = "child_user") +public class ChildUser extends User { + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.REMOVE) + @NotAudited + private List shipmentList; + + ChildUser() { + } + + public long getId() { + return id; + } +} \ No newline at end of file diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyDeleteTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyDeleteTest.java new file mode 100644 index 0000000000..ac0ced5971 --- /dev/null +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyDeleteTest.java @@ -0,0 +1,88 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.envers.test.integration.manytoone.lazy; + +import org.hibernate.Hibernate; +import org.hibernate.envers.configuration.EnversSettings; +import org.hibernate.envers.test.BaseEnversFunctionalTestCase; +import org.hibernate.envers.test.Priority; +import org.hibernate.testing.TestForIssue; +import org.junit.Test; + +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; +import java.util.Map; + +import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; +import static org.junit.Assert.assertEquals; + +/** + * Tests that proxies can still be resolved correctly in ToOneIdMapper even the object is already deleted and can't + * find in cache. This can happen if the deleted object is an inherited object, and when the child object is deleted, + * we cannot find the object with the parent class name anymore. + * + * @author Luke Chen + */ +@TestForIssue(jiraKey = "HHH-13945") +public class ManyToOneLazyDeleteTest extends BaseEnversFunctionalTestCase { + private Long shipmentId; + private User user; + + @Override + protected Class[] getAnnotatedClasses() { + return new Class[] { Shipment.class, Address.class, AddressVersion.class, User.class, ChildUser.class }; + } + + @Test + @Priority(10) + public void initData() { + + this.shipmentId = doInHibernate( this::sessionFactory, session -> { + final Shipment shipment = new Shipment( Instant.now(), "system", Instant.now().plus( Duration.ofDays( 3 ) ), "abcd123", null, null ); + session.persist( shipment ); + session.flush(); + + final Address origin = new Address( Instant.now(), "system", "Valencia#1" ); + final Address destination = new Address( Instant.now(), "system", "Madrid#3" ); + final AddressVersion originVersion0 = origin.addInitialVersion( "Poligono Manises" ); + final AddressVersion destinationVersion0 = destination.addInitialVersion( "Poligono Alcobendas" ); + user = new ChildUser(); + session.persist( origin ); + session.persist( destination ); + session.persist( user ); + + session.flush(); + shipment.setUser( user ); + shipment.setOrigin( originVersion0 ); + shipment.setDestination( destinationVersion0 ); + + session.merge( shipment ); + session.flush(); + + return shipment.getId(); + } ); + + doInHibernate( this::sessionFactory, session -> { + final Shipment shipment = session.get( Shipment.class, shipmentId ); + session.remove(shipment); + // Cast the User instance to the ChildUser, and delete the child one, so the cache for + // the User instance will not be there, and entityNotFound exception will be thrown while envers processing it + ChildUser childUser = session.get(ChildUser.class, user.getId()); + session.remove(childUser); + + session.flush(); + } ); + } + + @Override + protected void addSettings(Map settings) { + super.addSettings( settings ); + + settings.put(EnversSettings.STORE_DATA_AT_DELETE, "true"); + } +} diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/Shipment.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/Shipment.java index 2dae856930..d21a4b7ca3 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/Shipment.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/Shipment.java @@ -62,6 +62,11 @@ public class Shipment extends BaseDomainEntity { @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) private AddressVersion destination; + @ManyToOne(optional = true, fetch = FetchType.LAZY) + @JoinColumn(name = "user_id", referencedColumnName = "id", nullable = true) + @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) + private User user; + Shipment() { } @@ -104,4 +109,8 @@ public class Shipment extends BaseDomainEntity { public void setDestination(AddressVersion destination) { this.destination = destination; } + + public void setUser(User user) { + this.user = user; + } } \ No newline at end of file diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java new file mode 100644 index 0000000000..a4847952df --- /dev/null +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java @@ -0,0 +1,43 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.envers.test.integration.manytoone.lazy; + +import org.hibernate.envers.NotAudited; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import java.time.Instant; +import java.util.List; + +/** + * @author Luke Chen + */ +@Entity +@Table(name = "user") +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + protected long id = 0; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.REMOVE) + @NotAudited + private List shipmentList; + + User() { + } + + public long getId() { + return id; + } +} \ No newline at end of file From e3a9ee61f2fb749e9e470971d7d53b3f9ecc73bb Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Thu, 19 Nov 2020 18:00:40 +0800 Subject: [PATCH 7/8] HHH-13945: add debug log during exception thrown --- .../internal/entities/mapper/relation/ToOneIdMapper.java | 9 +++++++-- .../manytoone/lazy/ManyToOneLazyFetchTest.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java b/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java index 91728d6d25..2d00782735 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/mapper/relation/ToOneIdMapper.java @@ -20,6 +20,7 @@ import org.hibernate.envers.internal.tools.EntityTools; import org.hibernate.envers.internal.tools.query.Parameters; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.proxy.HibernateProxy; +import org.jboss.logging.Logger; import javax.persistence.PersistenceException; @@ -28,8 +29,10 @@ import javax.persistence.PersistenceException; * @author HernпїЅn Chanfreau * @author Michal Skowronek (mskowr at o2 dot pl) * @author Chris Cranford + * @author Luke Chen */ public class ToOneIdMapper extends AbstractToOneMapper { + private static final Logger log = Logger.getLogger( ToOneIdMapper.class ); private final IdMapper delegate; private final String referencedEntityName; private final boolean nonInsertableFake; @@ -67,8 +70,10 @@ public class ToOneIdMapper extends AbstractToOneMapper { if ( lazyMapping && entity instanceof HibernateProxy ) { try { entity = ((HibernateProxy) entity).getHibernateLazyInitializer().getImplementation(); - } catch ( PersistenceException e ) { - // Ignore the exception and fallback to call mapToMapFromEntity directly + } + catch ( PersistenceException e ) { + log.debug( "Ignore PersistenceException while initializing the entity, " + + "and fallback to call mapToMapFromEntity directly" ); } } diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyFetchTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyFetchTest.java index 5191cc1803..f7cea06d76 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyFetchTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/ManyToOneLazyFetchTest.java @@ -32,7 +32,7 @@ public class ManyToOneLazyFetchTest extends BaseEnversFunctionalTestCase { @Override protected Class[] getAnnotatedClasses() { - return new Class[] { Shipment.class, Address.class, AddressVersion.class }; + return new Class[] { Shipment.class, Address.class, AddressVersion.class, User.class, ChildUser.class }; } @Test From c3eaa7cf303f986039425cbd9bd99b0f89423ac8 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Mon, 23 Nov 2020 14:44:51 +0100 Subject: [PATCH 8/8] HHH-13945 Fix issues on PostgreSQL --- .../hibernate/envers/test/integration/manytoone/lazy/User.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java index a4847952df..d659a80875 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytoone/lazy/User.java @@ -23,7 +23,7 @@ import java.util.List; * @author Luke Chen */ @Entity -@Table(name = "user") +@Table(name = "user_tbl") public class User { @Id