diff --git a/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/LoaderSelectBuilder.java b/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/LoaderSelectBuilder.java index 90bc600e31..697ba75f12 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/LoaderSelectBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/LoaderSelectBuilder.java @@ -22,6 +22,8 @@ import org.hibernate.collection.spi.BagSemantics; import org.hibernate.engine.FetchStyle; import org.hibernate.engine.FetchTiming; import org.hibernate.engine.profile.FetchProfile; +import org.hibernate.engine.spi.CascadeStyle; +import org.hibernate.engine.spi.CascadingAction; import org.hibernate.engine.spi.EffectiveEntityGraph; import org.hibernate.engine.spi.LoadQueryInfluencers; import org.hibernate.engine.spi.SessionFactoryImplementor; @@ -32,6 +34,7 @@ import org.hibernate.internal.FilterHelper; import org.hibernate.loader.MultipleBagFetchException; import org.hibernate.loader.ast.spi.Loadable; import org.hibernate.loader.ast.spi.Loader; +import org.hibernate.metamodel.mapping.AttributeMapping; import org.hibernate.metamodel.mapping.BasicValuedModelPart; import org.hibernate.metamodel.mapping.CollectionPart; import org.hibernate.metamodel.mapping.EntityIdentifierMapping; @@ -80,6 +83,7 @@ import org.hibernate.sql.results.graph.entity.EntityResultGraphNode; import org.hibernate.sql.results.graph.entity.EntityValuedFetchable; import org.hibernate.sql.results.internal.SqlSelectionImpl; import org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl; +import org.hibernate.tuple.entity.EntityMetamodel; import org.jboss.logging.Logger; @@ -248,6 +252,7 @@ public class LoaderSelectBuilder { private int fetchDepth; private Map orderByFragments; + private boolean hasCollectionJoinFetches; private LoaderSelectBuilder( SqlAstCreationContext creationContext, @@ -731,6 +736,18 @@ public class LoaderSelectBuilder { } } } + else if ( loadQueryInfluencers.getEnabledCascadingFetchProfile() != null ) { + final CascadeStyle cascadeStyle = ( (AttributeMapping) fetchable ).getAttributeMetadataAccess() + .resolveAttributeMetadata( fetchable.findContainingEntityMapping() ) + .getCascadeStyle(); + final CascadingAction cascadingAction = loadQueryInfluencers.getEnabledCascadingFetchProfile() + .getCascadingAction(); + if ( cascadeStyle == null || cascadeStyle.doCascade( cascadingAction ) ) { + fetchTiming = FetchTiming.IMMEDIATE; + // In 5.x the CascadeEntityJoinWalker only join fetched the first collection fetch + joined = !hasCollectionJoinFetches; + } + } } final Integer maximumFetchDepth = creationContext.getMaximumFetchDepth(); @@ -771,6 +788,7 @@ public class LoaderSelectBuilder { bagRoles.add( fetchable.getNavigableRole().getNavigableName() ); } if ( joined ) { + hasCollectionJoinFetches = true; final TableGroup joinTableGroup = creationState.getFromClauseAccess() .getTableGroup( fetchablePath ); applyFiltering( diff --git a/hibernate-core/src/main/java/org/hibernate/loader/ast/spi/CascadingFetchProfile.java b/hibernate-core/src/main/java/org/hibernate/loader/ast/spi/CascadingFetchProfile.java index ed7bba6b27..e3d096d46c 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/ast/spi/CascadingFetchProfile.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/ast/spi/CascadingFetchProfile.java @@ -6,25 +6,33 @@ */ package org.hibernate.loader.ast.spi; +import org.hibernate.engine.spi.CascadingAction; +import org.hibernate.engine.spi.CascadingActions; import org.hibernate.internal.util.StringHelper; /** * @author Steve Ebersole */ public enum CascadingFetchProfile { - MERGE( "merge" ), - REFRESH( "refresh" ); + MERGE( "merge", CascadingActions.MERGE ), + REFRESH( "refresh", CascadingActions.REFRESH ); private final String legacyName; + private final CascadingAction cascadingAction; - CascadingFetchProfile(String legacyName) { + CascadingFetchProfile(String legacyName, CascadingAction cascadingAction) { this.legacyName = legacyName; + this.cascadingAction = cascadingAction; } public String getLegacyName() { return legacyName; } + public CascadingAction getCascadingAction() { + return cascadingAction; + } + public static CascadingFetchProfile fromLegacyName(String legacyName) { if ( StringHelper.isEmpty( legacyName ) ) { return null; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ForeignKeyDescriptor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ForeignKeyDescriptor.java index 2c5a50c749..32d3ac4641 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ForeignKeyDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ForeignKeyDescriptor.java @@ -25,6 +25,7 @@ import org.hibernate.sql.results.graph.DomainResultCreationState; */ public interface ForeignKeyDescriptor extends VirtualModelPart { String PART_NAME = "{fk}"; + String TARGET_PART_NAME = "{fk-target}"; String getKeyTable(); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java index f002fa9179..97b801842a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java @@ -237,11 +237,21 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor { EmbeddableValuedModelPart modelPart, DomainResultCreationState creationState) { final NavigablePath fkNavigablePath = navigablePath.append( getPartName() ); - creationState.getSqlAstCreationState().getFromClauseAccess().resolveTableGroup( - fkNavigablePath, + final NavigablePath resultNavigablePath; + if ( associationKey.getTable().equals( columnContainingTable ) ) { + // todo (6.0): what if we append the actual model part and maybe prefix with `{element}` +// resultNavigablePath = navigablePath.append( modelPart.getFetchableName() ); + // todo (6.0): note that the following is only necessary for detecting circular fetch cycles in ToOneAttributeMapping + resultNavigablePath = navigablePath.append( ForeignKeyDescriptor.TARGET_PART_NAME ); + } + else { + resultNavigablePath = navigablePath.append( getPartName() ); + } + final TableGroup fkTableGroup = creationState.getSqlAstCreationState().getFromClauseAccess().resolveTableGroup( + resultNavigablePath, np -> { final TableGroupJoin tableGroupJoin = modelPart.createTableGroupJoin( - fkNavigablePath, + resultNavigablePath, tableGroup, null, SqlAstJoinType.INNER, @@ -251,11 +261,16 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor { ); return tableGroupJoin.getJoinedGroup(); } - ); + if ( fkNavigablePath != resultNavigablePath ) { + creationState.getSqlAstCreationState().getFromClauseAccess().resolveTableGroup( + fkNavigablePath, + np -> fkTableGroup + ); + } return new EmbeddableForeignKeyResultImpl<>( - navigablePath, + resultNavigablePath, modelPart, null, creationState @@ -457,7 +472,7 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor { ); return new EmbeddableForeignKeyResultImpl<>( - navigablePath, + fkNavigablePath, keyMappingType, resultVariable, creationState diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java index a80a98692a..192cc6653a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java @@ -799,6 +799,11 @@ public class MappingModelCreationHelper { public boolean isIncludedInOptimisticLocking() { return bootProperty.isOptimisticLocked(); } + + @Override + public CascadeStyle getCascadeStyle() { + return cascadeStyle; + } }; final FetchStyle style = FetchStrategyHelper.determineFetchStyleByMetadata( diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java index a0f9b9b979..b33ac402de 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java @@ -380,7 +380,10 @@ public class ToOneAttributeMapping private Key key; } */ - if ( parentNavigablePath.getLocalName().equals( ForeignKeyDescriptor.PART_NAME ) ) { + if ( parentNavigablePath.getLocalName() + .equals( ForeignKeyDescriptor.TARGET_PART_NAME ) || parentNavigablePath.getLocalName().equals( + ForeignKeyDescriptor.PART_NAME ) ) { + // todo (6.0): maybe it's better to have a flag in creation state that marks if we are building a circular fetch domain result already to skip this? return null; } @@ -709,7 +712,7 @@ public class ToOneAttributeMapping if ( isNullable ) { sqlAstJoinType = SqlAstJoinType.LEFT; } - else if ( parentTableGroup.getModelPart() instanceof EmbeddedCollectionPart ) { + else if ( parentTableGroup.getModelPart() instanceof CollectionPart ) { sqlAstJoinType = SqlAstJoinType.LEFT; } else { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/internal/EmbeddableForeignKeyResultImpl.java b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/internal/EmbeddableForeignKeyResultImpl.java index 6867fac8dc..460e91d5a1 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/internal/EmbeddableForeignKeyResultImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/internal/EmbeddableForeignKeyResultImpl.java @@ -37,7 +37,7 @@ public class EmbeddableForeignKeyResultImpl EmbeddableValuedModelPart embeddableValuedModelPart, String resultVariable, DomainResultCreationState creationState) { - super( embeddableValuedModelPart.getEmbeddableTypeDescriptor(), navigablePath.append( ROLE_LOCAL_NAME ) ); + super( embeddableValuedModelPart.getEmbeddableTypeDescriptor(), navigablePath ); this.resultVariable = resultVariable; this.fetches = creationState.visitFetches( this ); } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityAssembler.java b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityAssembler.java index dcaecccb07..0f5673e16b 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityAssembler.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityAssembler.java @@ -34,6 +34,10 @@ public class EntityAssembler implements DomainResultAssembler { @Override public Object assemble(RowProcessingState rowProcessingState, JdbcValuesSourceProcessingOptions options) { + // Ensure that the instance really is initialized + // This is important for key-many-to-ones that are part of a collection key fk, + // as the instance is needed for resolveKey before initializing the instance in RowReader + initializer.resolveInstance( rowProcessingState ); return initializer.getEntityInstance(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java index a6bc779d10..5d9d8ff4b4 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java @@ -11,6 +11,7 @@ import org.hibernate.engine.FetchStrategy; import org.hibernate.engine.FetchTiming; import org.hibernate.engine.spi.CollectionKey; import org.hibernate.engine.spi.EntityKey; +import org.hibernate.engine.spi.PersistenceContext; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.metamodel.mapping.Association; import org.hibernate.metamodel.mapping.AttributeMapping; @@ -199,7 +200,14 @@ public class CircularBiDirectionalFetchImpl implements BiDirectionalFetch, Assoc final SharedSessionContractImplementor session = rowProcessingState.getJdbcValuesSourceProcessingState() .getSession(); - return session.getPersistenceContext().getEntity( entityKey ); + final PersistenceContext persistenceContext = session.getPersistenceContext(); + final Object proxy = persistenceContext.getProxy( entityKey ); + // it is conceivable there is a proxy, so check that first + if ( proxy == null ) { + // otherwise look for an initialized version + return persistenceContext.getEntity( entityKey ); + } + return proxy; } } if ( initializer.getInitializedInstance() == null ) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/classloader/ProxyInterfaceClassLoaderTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/classloader/ProxyInterfaceClassLoaderTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/classloader/ProxyInterfaceClassLoaderTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/classloader/ProxyInterfaceClassLoaderTest.java index d8d0467804..1305efdbe2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/classloader/ProxyInterfaceClassLoaderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/classloader/ProxyInterfaceClassLoaderTest.java @@ -4,7 +4,7 @@ * 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.test.classloader; +package org.hibernate.orm.test.classloader; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/hibernate-core/src/test/java/org/hibernate/test/comments/TestEntity.java b/hibernate-core/src/test/java/org/hibernate/orm/test/comments/TestEntity.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/comments/TestEntity.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/comments/TestEntity.java index 7c425becc4..18118abfa7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/comments/TestEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/comments/TestEntity.java @@ -4,7 +4,7 @@ * 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.test.comments; +package org.hibernate.orm.test.comments; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/hibernate-core/src/test/java/org/hibernate/test/comments/TestEntity2.java b/hibernate-core/src/test/java/org/hibernate/orm/test/comments/TestEntity2.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/test/comments/TestEntity2.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/comments/TestEntity2.java index 58b626df60..797e7abd0e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/comments/TestEntity2.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/comments/TestEntity2.java @@ -4,7 +4,7 @@ * 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.test.comments; +package org.hibernate.orm.test.comments; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/hibernate-core/src/test/java/org/hibernate/test/comments/UseSqlCommentTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/comments/UseSqlCommentTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/comments/UseSqlCommentTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/comments/UseSqlCommentTest.java index 2bd6adf8c8..208d6ceb87 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/comments/UseSqlCommentTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/comments/UseSqlCommentTest.java @@ -4,7 +4,7 @@ * 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.test.comments; +package org.hibernate.orm.test.comments; import java.util.List; import java.util.Map; @@ -100,7 +100,7 @@ public class UseSqlCommentTest extends BaseEntityManagerFunctionalTestCase { public List findUsingQuery(String id, String appendLiteral, EntityManager entityManager) { TypedQuery query = entityManager.createQuery( - "select new org.hibernate.test.comments.TestEntity(id, '" + "select new " + TestEntity.class.getName() + "(id, '" + appendLiteral.replace( "'", "''" ) + "') from TestEntity where id=:where_id", TestEntity.class diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/AggressiveReleaseTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/AggressiveReleaseTest.java index 4436313878..6ee3b17cfc 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/AggressiveReleaseTest.java @@ -6,16 +6,14 @@ */ // $Id: AggressiveReleaseTest.java 10977 2006-12-12 23:28:04Z steve.ebersole@jboss.com $ -package org.hibernate.test.connections; +package org.hibernate.orm.test.connections; import java.sql.Connection; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Map; import org.hibernate.ConnectionReleaseMode; -import org.hibernate.Hibernate; import org.hibernate.ScrollableResults; import org.hibernate.Session; import org.hibernate.cfg.AvailableSettings; @@ -115,6 +113,7 @@ public class AggressiveReleaseTest extends ConnectionManagementTestCase { // to resources, which should make aggressive-release not release // the connection (and thus cause serialization to fail) ScrollableResults sr = s.createQuery( "from Silly" ).scroll(); + sr.next(); try { SerializationHelper.serialize( s ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/BasicConnectionProviderTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/BasicConnectionProviderTest.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/connections/BasicConnectionProviderTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/BasicConnectionProviderTest.java index a5e8277021..c85115d179 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/BasicConnectionProviderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/BasicConnectionProviderTest.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; import java.util.Map; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/BeforeCompletionReleaseTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/BeforeCompletionReleaseTest.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/connections/BeforeCompletionReleaseTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/BeforeCompletionReleaseTest.java index 69305549d8..f20e591736 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/BeforeCompletionReleaseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/BeforeCompletionReleaseTest.java @@ -5,7 +5,7 @@ * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.connections; +package org.hibernate.orm.test.connections; import java.sql.Connection; import java.sql.SQLException; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/ConnectionManagementTestCase.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/ConnectionManagementTestCase.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/connections/ConnectionManagementTestCase.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/ConnectionManagementTestCase.java index 6b65afb752..7caee62810 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/ConnectionManagementTestCase.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/ConnectionManagementTestCase.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; import org.hibernate.Session; import org.hibernate.Transaction; @@ -31,6 +31,12 @@ import static org.junit.Assert.fail; */ public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunctionalTestCase { + + @Override + protected String getBaseForMappings() { + return "org/hibernate/orm/test/"; + } + @Override public final String[] getMappings() { return new String[] { "connections/Silly.hbm.xml" }; @@ -126,7 +132,7 @@ public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunc Session sessionUnderTest = getSessionUnderTest(); // force the connection to be retained - sessionUnderTest.createQuery( "from Silly" ).scroll(); + sessionUnderTest.createQuery( "from Silly" ).scroll().next(); try { SerializationHelper.serialize( sessionUnderTest ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/CurrentSessionConnectionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/CurrentSessionConnectionTest.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/connections/CurrentSessionConnectionTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/CurrentSessionConnectionTest.java index deab882bbe..908ab6f06e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/CurrentSessionConnectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/CurrentSessionConnectionTest.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; import org.hibernate.Session; import org.hibernate.dialect.H2Dialect; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/ExplicitConnectionProviderInstanceTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/ExplicitConnectionProviderInstanceTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/connections/ExplicitConnectionProviderInstanceTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/ExplicitConnectionProviderInstanceTest.java index 23779e6afb..17e7dd9723 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/ExplicitConnectionProviderInstanceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/ExplicitConnectionProviderInstanceTest.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; import java.sql.Connection; import java.sql.SQLException; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/HibernateCreateBlobFailedCase.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/HibernateCreateBlobFailedCase.java similarity index 91% rename from hibernate-core/src/test/java/org/hibernate/test/connections/HibernateCreateBlobFailedCase.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/HibernateCreateBlobFailedCase.java index d0d59d31d5..05f7d4f5a5 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/HibernateCreateBlobFailedCase.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/HibernateCreateBlobFailedCase.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; import java.sql.Blob; import java.sql.Clob; @@ -26,6 +26,12 @@ import static org.junit.Assert.assertFalse; * @author Steve Ebersole */ public class HibernateCreateBlobFailedCase extends BaseCoreFunctionalTestCase { + + @Override + protected String getBaseForMappings() { + return "org/hibernate/orm/test/"; + } + @Override public String[] getMappings() { return new String[] { "connections/Silly.hbm.xml" }; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/JdbcBatchingAgressiveReleaseTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/JdbcBatchingAgressiveReleaseTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/connections/JdbcBatchingAgressiveReleaseTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/JdbcBatchingAgressiveReleaseTest.java index f13c8dff7a..5fe9fe6b84 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/JdbcBatchingAgressiveReleaseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/JdbcBatchingAgressiveReleaseTest.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; import java.util.Map; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/Other.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/Other.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/test/connections/Other.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/Other.java index a1b3682530..f6305f9c5a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/Other.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/Other.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/Silly.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/Silly.hbm.xml similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/connections/Silly.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/Silly.hbm.xml index 615391a052..1136d7a361 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/Silly.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/Silly.hbm.xml @@ -9,7 +9,7 @@ "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/Silly.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/Silly.java similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/test/connections/Silly.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/Silly.java index 56ba266874..a743bb1483 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/Silly.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/Silly.java @@ -6,7 +6,7 @@ */ // $Id: Silly.java 9595 2006-03-10 18:14:21Z steve.ebersole@jboss.com $ -package org.hibernate.test.connections; +package org.hibernate.orm.test.connections; import java.io.Serializable; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/SuppliedConnectionTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/SuppliedConnectionTest.java index 269c1530ab..52d1fd7a25 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/SuppliedConnectionTest.java @@ -5,7 +5,7 @@ * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.connections; +package org.hibernate.orm.test.connections; import java.sql.Connection; import java.sql.ResultSet; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/ThreadLocalCurrentSessionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/ThreadLocalCurrentSessionTest.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/connections/ThreadLocalCurrentSessionTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/connections/ThreadLocalCurrentSessionTest.java index ac04d3a1cb..c72a3ff57b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/ThreadLocalCurrentSessionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/connections/ThreadLocalCurrentSessionTest.java @@ -4,7 +4,7 @@ * 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.test.connections; +package org.hibernate.orm.test.connections; import java.util.Map; diff --git a/hibernate-core/src/test/java/org/hibernate/test/entityname/Car.java b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Car.java similarity index 90% rename from hibernate-core/src/test/java/org/hibernate/test/entityname/Car.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Car.java index 2007985605..f5f982749f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entityname/Car.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Car.java @@ -6,7 +6,7 @@ */ // $Id: Car.java 7087 2005-06-08 18:23:44Z steveebersole $ -package org.hibernate.test.entityname; +package org.hibernate.orm.test.entityname; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/entityname/DuplicateEntityNameTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/DuplicateEntityNameTest.java similarity index 81% rename from hibernate-core/src/test/java/org/hibernate/test/entityname/DuplicateEntityNameTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/entityname/DuplicateEntityNameTest.java index 01eb4eb56a..886c26c6a2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entityname/DuplicateEntityNameTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/DuplicateEntityNameTest.java @@ -4,7 +4,7 @@ * 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.test.entityname; +package org.hibernate.orm.test.entityname; import javax.persistence.Entity; import javax.persistence.Id; @@ -39,7 +39,7 @@ public class DuplicateEntityNameTest extends BaseCoreFunctionalTestCase { fail("Should throw DuplicateMappingException"); } catch (DuplicateMappingException e) { - assertEquals( "The [org.hibernate.test.entityname.DuplicateEntityNameTest$Purchase1] and [org.hibernate.test.entityname.DuplicateEntityNameTest$Purchase2] entities share the same JPA entity name: [Purchase] which is not allowed!", e.getMessage() ); + assertEquals( "The [org.hibernate.orm.test.entityname.DuplicateEntityNameTest$Purchase1] and [org.hibernate.orm.test.entityname.DuplicateEntityNameTest$Purchase2] entities share the same JPA entity name: [Purchase], which is not allowed!", e.getMessage() ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/entityname/EntityNameFromSubClassTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/EntityNameFromSubClassTest.java similarity index 88% rename from hibernate-core/src/test/java/org/hibernate/test/entityname/EntityNameFromSubClassTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/entityname/EntityNameFromSubClassTest.java index 2a581c95eb..dede59fc01 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entityname/EntityNameFromSubClassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/EntityNameFromSubClassTest.java @@ -4,7 +4,7 @@ * 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.test.entityname; +package org.hibernate.orm.test.entityname; import org.junit.Test; import org.hibernate.Session; @@ -16,6 +16,13 @@ import static org.junit.Assert.assertEquals; * @author stliu */ public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase { + + @Override + protected String getBaseForMappings() { + return "org/hibernate/orm/test/"; + } + + @Override public String[] getMappings() { return new String[] { "entityname/Vehicle.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/entityname/Person.java b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Person.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/entityname/Person.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Person.java index dc2518172e..4ef104416d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entityname/Person.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Person.java @@ -4,7 +4,7 @@ * 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.test.entityname; +package org.hibernate.orm.test.entityname; import java.util.HashSet; import java.util.Set; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/entityname/Vehicle.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Vehicle.hbm.xml similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/entityname/Vehicle.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Vehicle.hbm.xml index 8c2ea75647..8a0f5a1ffb 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entityname/Vehicle.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Vehicle.hbm.xml @@ -9,7 +9,7 @@ "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/entityname/Vehicle.java b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Vehicle.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/entityname/Vehicle.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Vehicle.java index c36d5ecb1a..1cf223c24d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entityname/Vehicle.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/entityname/Vehicle.java @@ -6,7 +6,7 @@ */ // $Id: Vehicle.java 7087 2005-06-08 18:23:44Z steveebersole $ -package org.hibernate.test.entityname; +package org.hibernate.orm.test.entityname; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/AbstractCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/AbstractCollectionEventTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/AbstractCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/AbstractCollectionEventTest.java index ba56aa559a..1f129bcb06 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/AbstractCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/AbstractCollectionEventTest.java @@ -4,9 +4,10 @@ * 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.test.event.collection; +package org.hibernate.orm.test.event.collection; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -21,7 +22,7 @@ import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.event.spi.AbstractCollectionEvent; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.hibernate.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany; +import org.hibernate.orm.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -33,6 +34,12 @@ import static org.junit.Assert.assertSame; * @author Gail Badner */ public abstract class AbstractCollectionEventTest extends BaseCoreFunctionalTestCase { + + @Override + protected String getBaseForMappings() { + return "org/hibernate/orm/test/"; + } + @Override protected void cleanupTest() { ParentWithCollection dummyParent = createParent( "dummyParent" ); @@ -41,15 +48,19 @@ public abstract class AbstractCollectionEventTest extends BaseCoreFunctionalTest inTransaction( s -> { CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder(); - CriteriaQuery childrenCriteria = criteriaBuilder.createQuery( dummyChild.getClass() ); - childrenCriteria.from( dummyChild.getClass() ); - List children = s.createQuery( childrenCriteria ).list(); -// List children = s.createCriteria( dummyChild.getClass() ).list(); + List children; + if ( s.getFactory().getMetamodel().findEntityDescriptor( dummyChild.getClass() ) == null ) { + children = Collections.emptyList(); + } + else { + CriteriaQuery childrenCriteria = criteriaBuilder.createQuery( dummyChild.getClass() ); + childrenCriteria.from( dummyChild.getClass() ); + children = s.createQuery( childrenCriteria ).list(); + } CriteriaQuery parentsCriteria = criteriaBuilder.createQuery( dummyParent.getClass() ); - childrenCriteria.from( dummyParent.getClass() ); + parentsCriteria.from( dummyParent.getClass() ); List parents = s.createQuery( parentsCriteria ).list(); -// List parents = s.createCriteria( dummyParent.getClass() ).list(); for ( Iterator it = parents.iterator(); it.hasNext(); ) { ParentWithCollection parent = ( ParentWithCollection ) it.next(); parent.clearChildren(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/AbstractParentWithCollection.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/AbstractParentWithCollection.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/AbstractParentWithCollection.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/AbstractParentWithCollection.java index 70fa77cf87..5f063c2607 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/AbstractParentWithCollection.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/AbstractParentWithCollection.java @@ -7,7 +7,7 @@ //$Id: $ -package org.hibernate.test.event.collection; +package org.hibernate.orm.test.event.collection; import java.util.Collection; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/BrokenCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/BrokenCollectionEventTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/BrokenCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/BrokenCollectionEventTest.java index 49547799d3..31d3116f62 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/BrokenCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/BrokenCollectionEventTest.java @@ -4,7 +4,7 @@ * 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.test.event.collection; +package org.hibernate.orm.test.event.collection; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; @@ -19,8 +19,8 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.collection.spi.PersistentCollection; import org.hibernate.event.spi.AbstractCollectionEvent; -import org.hibernate.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany; -import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; +import org.hibernate.orm.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany; +import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; import org.hibernate.testing.DialectChecks; import org.hibernate.testing.FailureExpected; import org.hibernate.testing.RequiresDialectFeature; @@ -39,6 +39,13 @@ import static org.junit.Assert.assertSame; */ @RequiresDialectFeature(DialectChecks.SupportsNoColumnInsert.class) public class BrokenCollectionEventTest extends BaseCoreFunctionalTestCase { + + + @Override + protected String getBaseForMappings() { + return "org/hibernate/orm/test/"; + } + @Override public String[] getMappings() { return new String[] { "event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml" }; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/Child.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/Child.java similarity index 88% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/Child.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/Child.java index 5bfff3d3b6..7d0f4c9ae2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/Child.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/Child.java @@ -7,7 +7,7 @@ //$Id: $ -package org.hibernate.test.event.collection; +package org.hibernate.orm.test.event.collection; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/ChildEntity.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ChildEntity.java similarity index 91% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/ChildEntity.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ChildEntity.java index f847fc7eb4..8f8bba9819 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/ChildEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ChildEntity.java @@ -7,7 +7,7 @@ //$Id: $ -package org.hibernate.test.event.collection; +package org.hibernate.orm.test.event.collection; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/ChildValue.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ChildValue.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/ChildValue.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ChildValue.java index 9c61d5526a..572ba437c9 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/ChildValue.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ChildValue.java @@ -7,7 +7,7 @@ //$Id: $ -package org.hibernate.test.event.collection; +package org.hibernate.orm.test.event.collection; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/CollectionListeners.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/CollectionListeners.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/CollectionListeners.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/CollectionListeners.java index fd8648a33e..57374576fa 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/CollectionListeners.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/CollectionListeners.java @@ -4,7 +4,7 @@ * 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.test.event.collection; +package org.hibernate.orm.test.event.collection; import java.io.Serializable; import java.util.ArrayList; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/Entity.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/Entity.java similarity index 90% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/Entity.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/Entity.java index ed273ada10..be49dd6a56 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/Entity.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/Entity.java @@ -4,7 +4,7 @@ * 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.test.event.collection; +package org.hibernate.orm.test.event.collection; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/ParentWithCollection.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ParentWithCollection.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/ParentWithCollection.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ParentWithCollection.java index 320addf632..af292d7234 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/ParentWithCollection.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/ParentWithCollection.java @@ -7,7 +7,7 @@ //$Id: $ -package org.hibernate.test.event.collection; +package org.hibernate.orm.test.event.collection; import java.util.Collection; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/AbstractAssociationCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/AbstractAssociationCollectionEventTest.java similarity index 82% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/AbstractAssociationCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/AbstractAssociationCollectionEventTest.java index eed8aa2d8f..d996ed4f8d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/AbstractAssociationCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/AbstractAssociationCollectionEventTest.java @@ -4,17 +4,18 @@ * 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.test.event.collection.association; +package org.hibernate.orm.test.event.collection.association; import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.dialect.AbstractHANADialect; -import org.hibernate.test.event.collection.AbstractCollectionEventTest; -import org.hibernate.test.event.collection.ChildEntity; -import org.hibernate.test.event.collection.CollectionListeners; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany; +import org.hibernate.orm.test.event.collection.AbstractCollectionEventTest; +import org.hibernate.orm.test.event.collection.ChildEntity; +import org.hibernate.orm.test.event.collection.CollectionListeners; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany; + import org.hibernate.testing.SkipForDialect; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java similarity index 76% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java index 50d2467aa9..8956de2cb5 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java @@ -4,12 +4,12 @@ * 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.test.event.collection.association.bidirectional.manytomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.manytomany; import java.util.ArrayList; import java.util.Collection; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetMapping.hbm.xml similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetMapping.hbm.xml index 6ea6326bdc..544f8d8422 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java similarity index 76% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java index 55465658b0..34de99e0c7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java @@ -4,12 +4,12 @@ * 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.test.event.collection.association.bidirectional.manytomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.manytomany; import java.util.Collection; import java.util.HashSet; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetMapping.hbm.xml similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetMapping.hbm.xml index c7c2c8d5e8..8af4f19563 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/ChildWithBidirectionalManyToMany.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/ChildWithBidirectionalManyToMany.java similarity index 86% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/ChildWithBidirectionalManyToMany.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/ChildWithBidirectionalManyToMany.java index d78c57d3e6..47b0d3cf33 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/ChildWithBidirectionalManyToMany.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/ChildWithBidirectionalManyToMany.java @@ -7,10 +7,10 @@ //$Id: $ -package org.hibernate.test.event.collection.association.bidirectional.manytomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.manytomany; import java.util.Collection; -import org.hibernate.test.event.collection.ChildEntity; +import org.hibernate.orm.test.event.collection.ChildEntity; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/ParentWithBidirectionalManyToMany.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/ParentWithBidirectionalManyToMany.java similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/ParentWithBidirectionalManyToMany.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/ParentWithBidirectionalManyToMany.java index 3deb99bf3e..bec299916f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/ParentWithBidirectionalManyToMany.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/manytomany/ParentWithBidirectionalManyToMany.java @@ -7,13 +7,13 @@ //$Id: $ -package org.hibernate.test.event.collection.association.bidirectional.manytomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.manytomany; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; -import org.hibernate.test.event.collection.AbstractParentWithCollection; -import org.hibernate.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.AbstractParentWithCollection; +import org.hibernate.orm.test.event.collection.Child; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagCollectionEventTest.java similarity index 74% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagCollectionEventTest.java index 2ed127610d..007a607096 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagCollectionEventTest.java @@ -4,13 +4,13 @@ * 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.test.event.collection.association.bidirectional.onetomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.onetomany; import java.util.ArrayList; import java.util.Collection; -import org.hibernate.test.event.collection.Child; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.orm.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagMapping.hbm.xml similarity index 91% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagMapping.hbm.xml index d2e7afefca..acfa437151 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java similarity index 82% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java index 71e4a994eb..55a6f6acdf 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java @@ -4,9 +4,9 @@ * 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.test.event.collection.association.bidirectional.onetomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.onetomany; -import org.hibernate.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.ParentWithCollection; /** * @author Gail Badner diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml index 27f2c878d5..e3f1c17892 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetCollectionEventTest.java similarity index 74% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetCollectionEventTest.java index 8299896efa..a5d9c7937e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetCollectionEventTest.java @@ -4,13 +4,13 @@ * 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.test.event.collection.association.bidirectional.onetomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.onetomany; import java.util.Collection; import java.util.HashSet; -import org.hibernate.test.event.collection.Child; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.orm.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest; /** * @author Gail Badner diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetMapping.hbm.xml similarity index 91% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetMapping.hbm.xml index 776ee00789..2f503bb006 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManySetMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ChildWithManyToOne.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ChildWithManyToOne.java similarity index 74% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ChildWithManyToOne.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ChildWithManyToOne.java index 72a096cb2f..30310c4246 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ChildWithManyToOne.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ChildWithManyToOne.java @@ -7,9 +7,9 @@ //$Id: $ -package org.hibernate.test.event.collection.association.bidirectional.onetomany; -import org.hibernate.test.event.collection.ChildEntity; -import org.hibernate.test.event.collection.ParentWithCollection; +package org.hibernate.orm.test.event.collection.association.bidirectional.onetomany; +import org.hibernate.orm.test.event.collection.ChildEntity; +import org.hibernate.orm.test.event.collection.ParentWithCollection; /** * @author Gail Badner diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToMany.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToMany.java similarity index 86% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToMany.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToMany.java index 94bccbc587..6006ec3e86 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToMany.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToMany.java @@ -7,12 +7,12 @@ //$Id: $ -package org.hibernate.test.event.collection.association.bidirectional.onetomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.onetomany; import java.util.Collection; import java.util.Iterator; -import org.hibernate.test.event.collection.AbstractParentWithCollection; -import org.hibernate.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.AbstractParentWithCollection; +import org.hibernate.orm.test.event.collection.Child; /** * @@ -26,7 +26,7 @@ public class ParentWithBidirectionalOneToMany extends AbstractParentWithCollecti super( name ); } - public Child createChild( String name ) { + public Child createChild(String name ) { return new ChildWithManyToOne( name ); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java similarity index 86% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java index 43f1194113..c577125f3e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java @@ -7,7 +7,7 @@ //$Id: $ -package org.hibernate.test.event.collection.association.bidirectional.onetomany; +package org.hibernate.orm.test.event.collection.association.bidirectional.onetomany; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/ParentWithCollectionOfEntities.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/ParentWithCollectionOfEntities.java similarity index 67% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/ParentWithCollectionOfEntities.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/ParentWithCollectionOfEntities.java index a9453a2a07..477fe7f664 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/ParentWithCollectionOfEntities.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/ParentWithCollectionOfEntities.java @@ -7,10 +7,10 @@ //$Id: $ -package org.hibernate.test.event.collection.association.unidirectional; -import org.hibernate.test.event.collection.AbstractParentWithCollection; -import org.hibernate.test.event.collection.Child; -import org.hibernate.test.event.collection.ChildEntity; +package org.hibernate.orm.test.event.collection.association.unidirectional; +import org.hibernate.orm.test.event.collection.AbstractParentWithCollection; +import org.hibernate.orm.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.ChildEntity; /** * @author Gail Badner diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java similarity index 65% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java index fd042e5b9a..80a739e0d4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java @@ -4,16 +4,16 @@ * 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.test.event.collection.association.unidirectional.manytomany; +package org.hibernate.orm.test.event.collection.association.unidirectional.manytomany; import java.util.ArrayList; import java.util.Collection; -import org.hibernate.test.event.collection.Child; -import org.hibernate.test.event.collection.ChildEntity; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; -import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; +import org.hibernate.orm.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.ChildEntity; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; /** * @author Gail Badner diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagMapping.hbm.xml similarity index 82% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagMapping.hbm.xml index 239e7cbfa1..a27f18ce21 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + @@ -22,11 +22,11 @@ - + - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagCollectionEventTest.java similarity index 65% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagCollectionEventTest.java index 9db7e9e443..6ee7056e15 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagCollectionEventTest.java @@ -4,16 +4,16 @@ * 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.test.event.collection.association.unidirectional.onetomany; +package org.hibernate.orm.test.event.collection.association.unidirectional.onetomany; import java.util.ArrayList; import java.util.Collection; -import org.hibernate.test.event.collection.Child; -import org.hibernate.test.event.collection.ChildEntity; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; -import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; +import org.hibernate.orm.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.ChildEntity; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagMapping.hbm.xml similarity index 77% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagMapping.hbm.xml index 1087632a93..fb87176c89 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManyBagMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + @@ -22,11 +22,11 @@ - + - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetCollectionEventTest.java similarity index 69% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetCollectionEventTest.java index e668488af0..ec3579a805 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetCollectionEventTest.java @@ -4,14 +4,14 @@ * 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.test.event.collection.association.unidirectional.onetomany; +package org.hibernate.orm.test.event.collection.association.unidirectional.onetomany; import java.util.Collection; import java.util.HashSet; -import org.hibernate.test.event.collection.ParentWithCollection; -import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; -import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; +import org.hibernate.orm.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; /** * @author Gail Badner diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml similarity index 77% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml index 421f2a685b..a5fa7151ea 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + @@ -22,11 +22,11 @@ - + - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/AggregatedCollectionEventListener.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/AggregatedCollectionEventListener.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/AggregatedCollectionEventListener.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/AggregatedCollectionEventListener.java index 57d5fcfa62..14bcd05b8c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/AggregatedCollectionEventListener.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/AggregatedCollectionEventListener.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import java.io.Serializable; import java.util.ArrayList; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Alias.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Alias.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Alias.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Alias.java index f2e2458ad2..abfe1216e3 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Alias.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Alias.java @@ -4,14 +4,13 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Index; -import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.Table; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/BadMergeHandlingTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/BadMergeHandlingTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/BadMergeHandlingTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/BadMergeHandlingTest.java index 1e1ef8ab74..8d845af076 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/BadMergeHandlingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/BadMergeHandlingTest.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Character.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Character.java similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Character.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Character.java index 6964b7c12f..16b43b74e0 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Character.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Character.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import java.util.ArrayList; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/DetachedMultipleCollectionChangeTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/DetachedMultipleCollectionChangeTest.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/DetachedMultipleCollectionChangeTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/DetachedMultipleCollectionChangeTest.java index 29c6b30a9d..8e887d449b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/DetachedMultipleCollectionChangeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/DetachedMultipleCollectionChangeTest.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import java.io.Serializable; import java.util.ArrayList; @@ -15,6 +15,7 @@ import org.hibernate.event.spi.AbstractCollectionEvent; import org.hibernate.event.spi.PostCollectionRecreateEvent; import org.hibernate.event.spi.PreCollectionRemoveEvent; import org.hibernate.event.spi.PreCollectionUpdateEvent; +import org.hibernate.orm.test.event.collection.Entity; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -33,6 +34,11 @@ import static org.junit.Assert.assertSame; @TestForIssue( jiraKey = "HHH-6361" ) public class DetachedMultipleCollectionChangeTest extends BaseCoreFunctionalTestCase { + @Override + protected String getBaseForMappings() { + return "org/hibernate/orm/test/"; + } + @Override public String[] getMappings() { return new String[] { "event/collection/detached/MultipleCollectionBagMapping.hbm.xml" }; @@ -219,8 +225,8 @@ public class DetachedMultipleCollectionChangeTest extends BaseCoreFunctionalTest protected void checkListener( MultipleCollectionListeners listeners, MultipleCollectionListeners.Listener listenerExpected, - org.hibernate.test.event.collection.Entity ownerExpected, - List expectedCollectionEntrySnapshot, + Entity ownerExpected, + List expectedCollectionEntrySnapshot, int index) { AbstractCollectionEvent event = listeners .getEvents().get(index); diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Identifiable.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Identifiable.java similarity index 85% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Identifiable.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Identifiable.java index d326ed0899..b5d99b6847 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/Identifiable.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/Identifiable.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; /** * @author Steve Ebersole diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MergeCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MergeCollectionEventTest.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MergeCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MergeCollectionEventTest.java index ea6405853d..3835ec93bf 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MergeCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MergeCollectionEventTest.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import java.util.ArrayList; import java.util.Collections; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionBagMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionBagMapping.hbm.xml similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionBagMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionBagMapping.hbm.xml index 03a43992b7..628b0d3134 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionBagMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionBagMapping.hbm.xml @@ -13,7 +13,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionEntity.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionEntity.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionEntity.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionEntity.java index 5cf5b53a69..8102e05159 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionEntity.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import java.util.ArrayList; import java.util.List; @@ -19,7 +19,7 @@ import javax.persistence.JoinColumn; import javax.persistence.OneToMany; @Entity -public class MultipleCollectionEntity implements org.hibernate.test.event.collection.Entity { +public class MultipleCollectionEntity implements org.hibernate.orm.test.event.collection.Entity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionListeners.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionListeners.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionListeners.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionListeners.java index 80032c769c..18df577b3c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionListeners.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionListeners.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import java.io.Serializable; import java.util.ArrayList; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionRefEntity1.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionRefEntity1.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionRefEntity1.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionRefEntity1.java index 27a4460cbc..f41d9196f0 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionRefEntity1.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionRefEntity1.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import javax.persistence.Column; import javax.persistence.Entity; @@ -15,7 +15,7 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; @Entity -public class MultipleCollectionRefEntity1 implements org.hibernate.test.event.collection.Entity { +public class MultipleCollectionRefEntity1 implements org.hibernate.orm.test.event.collection.Entity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionRefEntity2.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionRefEntity2.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionRefEntity2.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionRefEntity2.java index b38c4c7543..4180334892 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/detached/MultipleCollectionRefEntity2.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/detached/MultipleCollectionRefEntity2.java @@ -4,7 +4,7 @@ * 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.test.event.collection.detached; +package org.hibernate.orm.test.event.collection.detached; import javax.persistence.Column; import javax.persistence.Entity; @@ -15,7 +15,7 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; @Entity -public class MultipleCollectionRefEntity2 implements org.hibernate.test.event.collection.Entity { +public class MultipleCollectionRefEntity2 implements org.hibernate.orm.test.event.collection.Entity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ParentWithCollectionOfValues.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ParentWithCollectionOfValues.java similarity index 69% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ParentWithCollectionOfValues.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ParentWithCollectionOfValues.java index a533234d0d..d8930a004a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ParentWithCollectionOfValues.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ParentWithCollectionOfValues.java @@ -7,10 +7,10 @@ //$Id: $ -package org.hibernate.test.event.collection.values; -import org.hibernate.test.event.collection.AbstractParentWithCollection; -import org.hibernate.test.event.collection.Child; -import org.hibernate.test.event.collection.ChildValue; +package org.hibernate.orm.test.event.collection.values; +import org.hibernate.orm.test.event.collection.AbstractParentWithCollection; +import org.hibernate.orm.test.event.collection.Child; +import org.hibernate.orm.test.event.collection.ChildValue; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ValuesBagCollectionEventTest.java similarity index 78% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagCollectionEventTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ValuesBagCollectionEventTest.java index 77a66c5314..3e90e39c3f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ValuesBagCollectionEventTest.java @@ -4,13 +4,13 @@ * 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.test.event.collection.values; +package org.hibernate.orm.test.event.collection.values; import java.util.ArrayList; import java.util.Collection; -import org.hibernate.test.event.collection.AbstractCollectionEventTest; -import org.hibernate.test.event.collection.ParentWithCollection; +import org.hibernate.orm.test.event.collection.AbstractCollectionEventTest; +import org.hibernate.orm.test.event.collection.ParentWithCollection; /** * diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagMapping.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ValuesBagMapping.hbm.xml similarity index 80% rename from hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagMapping.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ValuesBagMapping.hbm.xml index 775518bb45..593bb632e2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagMapping.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/collection/values/ValuesBagMapping.hbm.xml @@ -9,7 +9,7 @@ "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> - + @@ -18,11 +18,10 @@ - + - -Pr \ No newline at end of file + \ No newline at end of file diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/entity/MergeListPreAndPostPersistTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/event/entity/MergeListPreAndPostPersistTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistTest.java index 51cb405ed0..8d3a278b9f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/entity/MergeListPreAndPostPersistTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistTest.java @@ -4,7 +4,7 @@ * 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.test.event.entity; +package org.hibernate.orm.test.event.entity; import java.util.ArrayList; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java index 016c8e38cc..65cbdbebe6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java @@ -4,7 +4,7 @@ * 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.test.event.entity; +package org.hibernate.orm.test.event.entity; import java.util.ArrayList; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/events/AutoFlushEventListenerTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/AutoFlushEventListenerTest.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/events/AutoFlushEventListenerTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/events/AutoFlushEventListenerTest.java index 4999ffb2b8..29a554ea20 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/events/AutoFlushEventListenerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/AutoFlushEventListenerTest.java @@ -4,7 +4,7 @@ * 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.test.events; +package org.hibernate.orm.test.events; import java.util.ArrayList; import java.util.List; diff --git a/hibernate-core/src/test/java/org/hibernate/test/events/CallbackTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/CallbackTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/events/CallbackTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/events/CallbackTest.java index 14e1e72a2e..b01bc34c24 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/events/CallbackTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/CallbackTest.java @@ -4,7 +4,7 @@ * 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.test.events; +package org.hibernate.orm.test.events; import java.util.Set; diff --git a/hibernate-core/src/test/java/org/hibernate/test/events/ClearEventListenerTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/ClearEventListenerTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/events/ClearEventListenerTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/events/ClearEventListenerTest.java index 18326e9f68..5d9f180964 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/events/ClearEventListenerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/ClearEventListenerTest.java @@ -4,7 +4,7 @@ * 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.test.events; +package org.hibernate.orm.test.events; import org.hibernate.Session; import org.hibernate.boot.Metadata; diff --git a/hibernate-core/src/test/java/org/hibernate/test/events/EventEngineContributionsTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/EventEngineContributionsTests.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/events/EventEngineContributionsTests.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/events/EventEngineContributionsTests.java index b0fa04a569..d7fce33e10 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/events/EventEngineContributionsTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/EventEngineContributionsTests.java @@ -4,7 +4,7 @@ * 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.test.events; +package org.hibernate.orm.test.events; import java.util.Collection; import java.util.Collections; diff --git a/hibernate-core/src/test/java/org/hibernate/test/events/LegacyPostCommitListenerTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/LegacyPostCommitListenerTest.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/events/LegacyPostCommitListenerTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/events/LegacyPostCommitListenerTest.java index 85ed0d4627..a94923bccf 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/events/LegacyPostCommitListenerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/LegacyPostCommitListenerTest.java @@ -4,7 +4,7 @@ * 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.test.events; +package org.hibernate.orm.test.events; import org.hibernate.IrrelevantEntity; import org.hibernate.Session; diff --git a/hibernate-core/src/test/java/org/hibernate/test/events/PostCommitListenerTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/PostCommitListenerTest.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/events/PostCommitListenerTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/events/PostCommitListenerTest.java index db5fe91600..59583b4f34 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/events/PostCommitListenerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/PostCommitListenerTest.java @@ -4,7 +4,7 @@ * 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.test.events; +package org.hibernate.orm.test.events; import org.hibernate.IrrelevantEntity; import org.hibernate.Session; diff --git a/hibernate-core/src/test/java/org/hibernate/test/eviction/EvictionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/eviction/EvictionTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/eviction/EvictionTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/eviction/EvictionTest.java index acc998b9b7..358bfa1866 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/eviction/EvictionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/eviction/EvictionTest.java @@ -4,7 +4,7 @@ * 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.test.eviction; +package org.hibernate.orm.test.eviction; import org.hibernate.Session; diff --git a/hibernate-core/src/test/java/org/hibernate/test/eviction/IsolatedEvictableEntity.java b/hibernate-core/src/test/java/org/hibernate/orm/test/eviction/IsolatedEvictableEntity.java similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/eviction/IsolatedEvictableEntity.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/eviction/IsolatedEvictableEntity.java index 7957c222b3..3d6aa0380c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/eviction/IsolatedEvictableEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/eviction/IsolatedEvictableEntity.java @@ -4,7 +4,7 @@ * 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.test.eviction; +package org.hibernate.orm.test.eviction; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/hibernate-core/src/test/java/org/hibernate/test/exception/Group.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/Group.hbm.xml similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/exception/Group.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/exception/Group.hbm.xml index 3e73ef3cfa..2b4665451e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/exception/Group.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/Group.hbm.xml @@ -7,7 +7,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/exception/Group.java b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/Group.java similarity index 95% rename from hibernate-core/src/test/java/org/hibernate/test/exception/Group.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/exception/Group.java index d14b649ad3..532d40ce0e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/exception/Group.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/Group.java @@ -6,7 +6,7 @@ */ // $Id: Group.java 4746 2004-11-11 20:57:28Z steveebersole $ -package org.hibernate.test.exception; +package org.hibernate.orm.test.exception; import java.util.Set; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/exception/SQLExceptionConversionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/SQLExceptionConversionTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/exception/SQLExceptionConversionTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/exception/SQLExceptionConversionTest.java index ff1a2c5e53..70a6a772f7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/exception/SQLExceptionConversionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/SQLExceptionConversionTest.java @@ -4,7 +4,7 @@ * 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.test.exception; +package org.hibernate.orm.test.exception; import java.sql.Connection; import java.sql.PreparedStatement; @@ -34,6 +34,13 @@ import static org.junit.Assert.fail; * @author Steve Ebersole */ public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase { + + @Override + protected String getBaseForMappings() { + return "org/hibernate/orm/test/"; + } + + @Override public String[] getMappings() { return new String[] {"exception/User.hbm.xml", "exception/Group.hbm.xml"}; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/exception/User.hbm.xml b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/User.hbm.xml similarity index 92% rename from hibernate-core/src/test/java/org/hibernate/test/exception/User.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/orm/test/exception/User.hbm.xml index 8eebf33d37..f41a39bdb6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/exception/User.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/User.hbm.xml @@ -7,7 +7,7 @@ --> - + diff --git a/hibernate-core/src/test/java/org/hibernate/test/exception/User.java b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/User.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/exception/User.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/exception/User.java index 9d3c21c2b5..550106263d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/exception/User.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/exception/User.java @@ -6,7 +6,7 @@ */ // $Id: User.java 4746 2004-11-11 20:57:28Z steveebersole $ -package org.hibernate.test.exception; +package org.hibernate.orm.test.exception; import java.util.HashSet; import java.util.Set; diff --git a/hibernate-core/src/test/java/org/hibernate/test/fetch/runtime/managed/RuntimeFetchFromManagedTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/fetch/runtime/managed/RuntimeFetchFromManagedTest.java similarity index 99% rename from hibernate-core/src/test/java/org/hibernate/test/fetch/runtime/managed/RuntimeFetchFromManagedTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/fetch/runtime/managed/RuntimeFetchFromManagedTest.java index c4f645473f..7dadf7c225 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/fetch/runtime/managed/RuntimeFetchFromManagedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/fetch/runtime/managed/RuntimeFetchFromManagedTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.test.fetch.runtime.managed; +package org.hibernate.orm.test.fetch.runtime.managed; import java.util.Collections; import javax.persistence.Entity; diff --git a/hibernate-core/src/test/java/org/hibernate/test/fetch/runtime/managed/package-info.java b/hibernate-core/src/test/java/org/hibernate/orm/test/fetch/runtime/managed/package-info.java similarity index 87% rename from hibernate-core/src/test/java/org/hibernate/test/fetch/runtime/managed/package-info.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/fetch/runtime/managed/package-info.java index 2041bab4f7..c39e97dd96 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/fetch/runtime/managed/package-info.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/fetch/runtime/managed/package-info.java @@ -12,4 +12,4 @@ * * EntityGraph * * fetch profile (?) */ -package org.hibernate.test.fetch.runtime.managed; +package org.hibernate.orm.test.fetch.runtime.managed; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/immutable/entitywithmutablecollection/AbstractEntityWithOneToManyTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/immutable/entitywithmutablecollection/AbstractEntityWithOneToManyTest.java index d6cd87a766..c2321de718 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/immutable/entitywithmutablecollection/AbstractEntityWithOneToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/immutable/entitywithmutablecollection/AbstractEntityWithOneToManyTest.java @@ -20,6 +20,7 @@ import org.hibernate.StaleObjectStateException; import org.hibernate.StaleStateException; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.jpa.QueryHints; import org.hibernate.metamodel.MappingMetamodel; import org.hibernate.query.spi.QueryImplementor; @@ -1197,24 +1198,27 @@ public abstract class AbstractEntityWithOneToManyTest { CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder(); CriteriaQuery criteria = criteriaBuilder.createQuery( Contract.class ); criteria.from( Contract.class ); - - QueryImplementor query = s.createQuery( criteria ); - query.setHint( "javax.persistence.fetchgraph", s.createEntityGraph( Contract.class) ); - return query.uniqueResult(); + return s.createQuery( criteria ) + .setHint( QueryHints.HINT_FETCHGRAPH, s.createEntityGraph( Contract.class ) ) + .uniqueResult(); } private ContractVariation getContractVariation(SessionImplementor s) { CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder(); CriteriaQuery criteria = criteriaBuilder.createQuery( ContractVariation.class ); criteria.from( ContractVariation.class ); - return s.createQuery( criteria ).uniqueResult(); + return s.createQuery( criteria ) + .setHint( QueryHints.HINT_FETCHGRAPH, s.createEntityGraph( ContractVariation.class ) ) + .uniqueResult(); } private Party getParty(SessionImplementor s) { CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder(); CriteriaQuery criteria = criteriaBuilder.createQuery( Party.class ); criteria.from( Party.class ); - return s.createQuery( criteria ).uniqueResult(); + return s.createQuery( criteria ) + .setHint( QueryHints.HINT_FETCHGRAPH, s.createEntityGraph( Party.class ) ) + .uniqueResult(); } private void assertPartyAndContractAreDeleted(SessionImplementor s) {