Move classloader, comments, connections, entityname, event, events, eviction, exception and fetch packages. Fix issues with key-many-to-one in collection key FK and implement cascade based fetching
This commit is contained in:
parent
c87a50ca0f
commit
181ac6e0ff
|
@ -22,6 +22,8 @@ import org.hibernate.collection.spi.BagSemantics;
|
||||||
import org.hibernate.engine.FetchStyle;
|
import org.hibernate.engine.FetchStyle;
|
||||||
import org.hibernate.engine.FetchTiming;
|
import org.hibernate.engine.FetchTiming;
|
||||||
import org.hibernate.engine.profile.FetchProfile;
|
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.EffectiveEntityGraph;
|
||||||
import org.hibernate.engine.spi.LoadQueryInfluencers;
|
import org.hibernate.engine.spi.LoadQueryInfluencers;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
|
@ -32,6 +34,7 @@ import org.hibernate.internal.FilterHelper;
|
||||||
import org.hibernate.loader.MultipleBagFetchException;
|
import org.hibernate.loader.MultipleBagFetchException;
|
||||||
import org.hibernate.loader.ast.spi.Loadable;
|
import org.hibernate.loader.ast.spi.Loadable;
|
||||||
import org.hibernate.loader.ast.spi.Loader;
|
import org.hibernate.loader.ast.spi.Loader;
|
||||||
|
import org.hibernate.metamodel.mapping.AttributeMapping;
|
||||||
import org.hibernate.metamodel.mapping.BasicValuedModelPart;
|
import org.hibernate.metamodel.mapping.BasicValuedModelPart;
|
||||||
import org.hibernate.metamodel.mapping.CollectionPart;
|
import org.hibernate.metamodel.mapping.CollectionPart;
|
||||||
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
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.graph.entity.EntityValuedFetchable;
|
||||||
import org.hibernate.sql.results.internal.SqlSelectionImpl;
|
import org.hibernate.sql.results.internal.SqlSelectionImpl;
|
||||||
import org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl;
|
import org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl;
|
||||||
|
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -248,6 +252,7 @@ public class LoaderSelectBuilder {
|
||||||
|
|
||||||
private int fetchDepth;
|
private int fetchDepth;
|
||||||
private Map<OrderByFragment, TableGroup> orderByFragments;
|
private Map<OrderByFragment, TableGroup> orderByFragments;
|
||||||
|
private boolean hasCollectionJoinFetches;
|
||||||
|
|
||||||
private LoaderSelectBuilder(
|
private LoaderSelectBuilder(
|
||||||
SqlAstCreationContext creationContext,
|
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();
|
final Integer maximumFetchDepth = creationContext.getMaximumFetchDepth();
|
||||||
|
@ -771,6 +788,7 @@ public class LoaderSelectBuilder {
|
||||||
bagRoles.add( fetchable.getNavigableRole().getNavigableName() );
|
bagRoles.add( fetchable.getNavigableRole().getNavigableName() );
|
||||||
}
|
}
|
||||||
if ( joined ) {
|
if ( joined ) {
|
||||||
|
hasCollectionJoinFetches = true;
|
||||||
final TableGroup joinTableGroup = creationState.getFromClauseAccess()
|
final TableGroup joinTableGroup = creationState.getFromClauseAccess()
|
||||||
.getTableGroup( fetchablePath );
|
.getTableGroup( fetchablePath );
|
||||||
applyFiltering(
|
applyFiltering(
|
||||||
|
|
|
@ -6,25 +6,33 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.loader.ast.spi;
|
package org.hibernate.loader.ast.spi;
|
||||||
|
|
||||||
|
import org.hibernate.engine.spi.CascadingAction;
|
||||||
|
import org.hibernate.engine.spi.CascadingActions;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public enum CascadingFetchProfile {
|
public enum CascadingFetchProfile {
|
||||||
MERGE( "merge" ),
|
MERGE( "merge", CascadingActions.MERGE ),
|
||||||
REFRESH( "refresh" );
|
REFRESH( "refresh", CascadingActions.REFRESH );
|
||||||
|
|
||||||
private final String legacyName;
|
private final String legacyName;
|
||||||
|
private final CascadingAction cascadingAction;
|
||||||
|
|
||||||
CascadingFetchProfile(String legacyName) {
|
CascadingFetchProfile(String legacyName, CascadingAction cascadingAction) {
|
||||||
this.legacyName = legacyName;
|
this.legacyName = legacyName;
|
||||||
|
this.cascadingAction = cascadingAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLegacyName() {
|
public String getLegacyName() {
|
||||||
return legacyName;
|
return legacyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CascadingAction getCascadingAction() {
|
||||||
|
return cascadingAction;
|
||||||
|
}
|
||||||
|
|
||||||
public static CascadingFetchProfile fromLegacyName(String legacyName) {
|
public static CascadingFetchProfile fromLegacyName(String legacyName) {
|
||||||
if ( StringHelper.isEmpty( legacyName ) ) {
|
if ( StringHelper.isEmpty( legacyName ) ) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||||
*/
|
*/
|
||||||
public interface ForeignKeyDescriptor extends VirtualModelPart {
|
public interface ForeignKeyDescriptor extends VirtualModelPart {
|
||||||
String PART_NAME = "{fk}";
|
String PART_NAME = "{fk}";
|
||||||
|
String TARGET_PART_NAME = "{fk-target}";
|
||||||
|
|
||||||
String getKeyTable();
|
String getKeyTable();
|
||||||
|
|
||||||
|
|
|
@ -237,11 +237,21 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor {
|
||||||
EmbeddableValuedModelPart modelPart,
|
EmbeddableValuedModelPart modelPart,
|
||||||
DomainResultCreationState creationState) {
|
DomainResultCreationState creationState) {
|
||||||
final NavigablePath fkNavigablePath = navigablePath.append( getPartName() );
|
final NavigablePath fkNavigablePath = navigablePath.append( getPartName() );
|
||||||
creationState.getSqlAstCreationState().getFromClauseAccess().resolveTableGroup(
|
final NavigablePath resultNavigablePath;
|
||||||
fkNavigablePath,
|
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 -> {
|
np -> {
|
||||||
final TableGroupJoin tableGroupJoin = modelPart.createTableGroupJoin(
|
final TableGroupJoin tableGroupJoin = modelPart.createTableGroupJoin(
|
||||||
fkNavigablePath,
|
resultNavigablePath,
|
||||||
tableGroup,
|
tableGroup,
|
||||||
null,
|
null,
|
||||||
SqlAstJoinType.INNER,
|
SqlAstJoinType.INNER,
|
||||||
|
@ -251,11 +261,16 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor {
|
||||||
);
|
);
|
||||||
return tableGroupJoin.getJoinedGroup();
|
return tableGroupJoin.getJoinedGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
);
|
);
|
||||||
|
if ( fkNavigablePath != resultNavigablePath ) {
|
||||||
|
creationState.getSqlAstCreationState().getFromClauseAccess().resolveTableGroup(
|
||||||
|
fkNavigablePath,
|
||||||
|
np -> fkTableGroup
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return new EmbeddableForeignKeyResultImpl<>(
|
return new EmbeddableForeignKeyResultImpl<>(
|
||||||
navigablePath,
|
resultNavigablePath,
|
||||||
modelPart,
|
modelPart,
|
||||||
null,
|
null,
|
||||||
creationState
|
creationState
|
||||||
|
@ -457,7 +472,7 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor {
|
||||||
);
|
);
|
||||||
|
|
||||||
return new EmbeddableForeignKeyResultImpl<>(
|
return new EmbeddableForeignKeyResultImpl<>(
|
||||||
navigablePath,
|
fkNavigablePath,
|
||||||
keyMappingType,
|
keyMappingType,
|
||||||
resultVariable,
|
resultVariable,
|
||||||
creationState
|
creationState
|
||||||
|
|
|
@ -799,6 +799,11 @@ public class MappingModelCreationHelper {
|
||||||
public boolean isIncludedInOptimisticLocking() {
|
public boolean isIncludedInOptimisticLocking() {
|
||||||
return bootProperty.isOptimisticLocked();
|
return bootProperty.isOptimisticLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CascadeStyle getCascadeStyle() {
|
||||||
|
return cascadeStyle;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
final FetchStyle style = FetchStrategyHelper.determineFetchStyleByMetadata(
|
final FetchStyle style = FetchStrategyHelper.determineFetchStyleByMetadata(
|
||||||
|
|
|
@ -380,7 +380,10 @@ public class ToOneAttributeMapping
|
||||||
private Key key;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,7 +712,7 @@ public class ToOneAttributeMapping
|
||||||
if ( isNullable ) {
|
if ( isNullable ) {
|
||||||
sqlAstJoinType = SqlAstJoinType.LEFT;
|
sqlAstJoinType = SqlAstJoinType.LEFT;
|
||||||
}
|
}
|
||||||
else if ( parentTableGroup.getModelPart() instanceof EmbeddedCollectionPart ) {
|
else if ( parentTableGroup.getModelPart() instanceof CollectionPart ) {
|
||||||
sqlAstJoinType = SqlAstJoinType.LEFT;
|
sqlAstJoinType = SqlAstJoinType.LEFT;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class EmbeddableForeignKeyResultImpl<T>
|
||||||
EmbeddableValuedModelPart embeddableValuedModelPart,
|
EmbeddableValuedModelPart embeddableValuedModelPart,
|
||||||
String resultVariable,
|
String resultVariable,
|
||||||
DomainResultCreationState creationState) {
|
DomainResultCreationState creationState) {
|
||||||
super( embeddableValuedModelPart.getEmbeddableTypeDescriptor(), navigablePath.append( ROLE_LOCAL_NAME ) );
|
super( embeddableValuedModelPart.getEmbeddableTypeDescriptor(), navigablePath );
|
||||||
this.resultVariable = resultVariable;
|
this.resultVariable = resultVariable;
|
||||||
this.fetches = creationState.visitFetches( this );
|
this.fetches = creationState.visitFetches( this );
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,10 @@ public class EntityAssembler implements DomainResultAssembler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object assemble(RowProcessingState rowProcessingState, JdbcValuesSourceProcessingOptions options) {
|
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();
|
return initializer.getEntityInstance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.hibernate.engine.FetchStrategy;
|
||||||
import org.hibernate.engine.FetchTiming;
|
import org.hibernate.engine.FetchTiming;
|
||||||
import org.hibernate.engine.spi.CollectionKey;
|
import org.hibernate.engine.spi.CollectionKey;
|
||||||
import org.hibernate.engine.spi.EntityKey;
|
import org.hibernate.engine.spi.EntityKey;
|
||||||
|
import org.hibernate.engine.spi.PersistenceContext;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
import org.hibernate.metamodel.mapping.Association;
|
import org.hibernate.metamodel.mapping.Association;
|
||||||
import org.hibernate.metamodel.mapping.AttributeMapping;
|
import org.hibernate.metamodel.mapping.AttributeMapping;
|
||||||
|
@ -199,7 +200,14 @@ public class CircularBiDirectionalFetchImpl implements BiDirectionalFetch, Assoc
|
||||||
|
|
||||||
final SharedSessionContractImplementor session = rowProcessingState.getJdbcValuesSourceProcessingState()
|
final SharedSessionContractImplementor session = rowProcessingState.getJdbcValuesSourceProcessingState()
|
||||||
.getSession();
|
.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 ) {
|
if ( initializer.getInitializedInstance() == null ) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.classloader;
|
package org.hibernate.orm.test.classloader;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.comments;
|
package org.hibernate.orm.test.comments;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.comments;
|
package org.hibernate.orm.test.comments;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.comments;
|
package org.hibernate.orm.test.comments;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -100,7 +100,7 @@ public class UseSqlCommentTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
public List<TestEntity> findUsingQuery(String id, String appendLiteral, EntityManager entityManager) {
|
public List<TestEntity> findUsingQuery(String id, String appendLiteral, EntityManager entityManager) {
|
||||||
TypedQuery<TestEntity> query =
|
TypedQuery<TestEntity> query =
|
||||||
entityManager.createQuery(
|
entityManager.createQuery(
|
||||||
"select new org.hibernate.test.comments.TestEntity(id, '"
|
"select new " + TestEntity.class.getName() + "(id, '"
|
||||||
+ appendLiteral.replace( "'", "''" )
|
+ appendLiteral.replace( "'", "''" )
|
||||||
+ "') from TestEntity where id=:where_id",
|
+ "') from TestEntity where id=:where_id",
|
||||||
TestEntity.class
|
TestEntity.class
|
|
@ -6,16 +6,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id: AggressiveReleaseTest.java 10977 2006-12-12 23:28:04Z steve.ebersole@jboss.com $
|
// $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.sql.Connection;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.hibernate.ConnectionReleaseMode;
|
import org.hibernate.ConnectionReleaseMode;
|
||||||
import org.hibernate.Hibernate;
|
|
||||||
import org.hibernate.ScrollableResults;
|
import org.hibernate.ScrollableResults;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
|
@ -115,6 +113,7 @@ public class AggressiveReleaseTest extends ConnectionManagementTestCase {
|
||||||
// to resources, which should make aggressive-release not release
|
// to resources, which should make aggressive-release not release
|
||||||
// the connection (and thus cause serialization to fail)
|
// the connection (and thus cause serialization to fail)
|
||||||
ScrollableResults sr = s.createQuery( "from Silly" ).scroll();
|
ScrollableResults sr = s.createQuery( "from Silly" ).scroll();
|
||||||
|
sr.next();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SerializationHelper.serialize( s );
|
SerializationHelper.serialize( s );
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.Transaction;
|
import org.hibernate.Transaction;
|
||||||
|
@ -31,6 +31,12 @@ import static org.junit.Assert.fail;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunctionalTestCase {
|
public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getBaseForMappings() {
|
||||||
|
return "org/hibernate/orm/test/";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String[] getMappings() {
|
public final String[] getMappings() {
|
||||||
return new String[] { "connections/Silly.hbm.xml" };
|
return new String[] { "connections/Silly.hbm.xml" };
|
||||||
|
@ -126,7 +132,7 @@ public abstract class ConnectionManagementTestCase extends BaseNonConfigCoreFunc
|
||||||
Session sessionUnderTest = getSessionUnderTest();
|
Session sessionUnderTest = getSessionUnderTest();
|
||||||
|
|
||||||
// force the connection to be retained
|
// force the connection to be retained
|
||||||
sessionUnderTest.createQuery( "from Silly" ).scroll();
|
sessionUnderTest.createQuery( "from Silly" ).scroll().next();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SerializationHelper.serialize( sessionUnderTest );
|
SerializationHelper.serialize( sessionUnderTest );
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.dialect.H2Dialect;
|
import org.hibernate.dialect.H2Dialect;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import java.sql.Blob;
|
import java.sql.Blob;
|
||||||
import java.sql.Clob;
|
import java.sql.Clob;
|
||||||
|
@ -26,6 +26,12 @@ import static org.junit.Assert.assertFalse;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class HibernateCreateBlobFailedCase extends BaseCoreFunctionalTestCase {
|
public class HibernateCreateBlobFailedCase extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getBaseForMappings() {
|
||||||
|
return "org/hibernate/orm/test/";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getMappings() {
|
public String[] getMappings() {
|
||||||
return new String[] { "connections/Silly.hbm.xml" };
|
return new String[] { "connections/Silly.hbm.xml" };
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -9,7 +9,7 @@
|
||||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.connections">
|
<hibernate-mapping package="org.hibernate.orm.test.connections">
|
||||||
|
|
||||||
<class name="Silly">
|
<class name="Silly">
|
||||||
<id name="id" type="long">
|
<id name="id" type="long">
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id: Silly.java 9595 2006-03-10 18:14:21Z steve.ebersole@jboss.com $
|
// $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;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -5,7 +5,7 @@
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.connections;
|
package org.hibernate.orm.test.connections;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id: Car.java 7087 2005-06-08 18:23:44Z steveebersole $
|
// $Id: Car.java 7087 2005-06-08 18:23:44Z steveebersole $
|
||||||
package org.hibernate.test.entityname;
|
package org.hibernate.orm.test.entityname;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.entityname;
|
package org.hibernate.orm.test.entityname;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
@ -39,7 +39,7 @@ public class DuplicateEntityNameTest extends BaseCoreFunctionalTestCase {
|
||||||
fail("Should throw DuplicateMappingException");
|
fail("Should throw DuplicateMappingException");
|
||||||
}
|
}
|
||||||
catch (DuplicateMappingException e) {
|
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() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.entityname;
|
package org.hibernate.orm.test.entityname;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
|
@ -16,6 +16,13 @@ import static org.junit.Assert.assertEquals;
|
||||||
* @author stliu
|
* @author stliu
|
||||||
*/
|
*/
|
||||||
public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase {
|
public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getBaseForMappings() {
|
||||||
|
return "org/hibernate/orm/test/";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getMappings() {
|
public String[] getMappings() {
|
||||||
return new String[] { "entityname/Vehicle.hbm.xml" };
|
return new String[] { "entityname/Vehicle.hbm.xml" };
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.entityname;
|
package org.hibernate.orm.test.entityname;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
/**
|
/**
|
|
@ -9,7 +9,7 @@
|
||||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.entityname">
|
<hibernate-mapping package="org.hibernate.orm.test.entityname">
|
||||||
|
|
||||||
<!-- Vehicle represents an abstract root of a union-subclass hierarchy -->
|
<!-- Vehicle represents an abstract root of a union-subclass hierarchy -->
|
||||||
<class name="Vehicle" abstract="true" entity-name="VEHICLE" discriminator-value="V">
|
<class name="Vehicle" abstract="true" entity-name="VEHICLE" discriminator-value="V">
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id: Vehicle.java 7087 2005-06-08 18:23:44Z steveebersole $
|
// $Id: Vehicle.java 7087 2005-06-08 18:23:44Z steveebersole $
|
||||||
package org.hibernate.test.entityname;
|
package org.hibernate.orm.test.entityname;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -4,9 +4,10 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ import org.hibernate.dialect.AbstractHANADialect;
|
||||||
import org.hibernate.event.spi.AbstractCollectionEvent;
|
import org.hibernate.event.spi.AbstractCollectionEvent;
|
||||||
import org.hibernate.testing.SkipForDialect;
|
import org.hibernate.testing.SkipForDialect;
|
||||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
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 org.junit.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
@ -33,6 +34,12 @@ import static org.junit.Assert.assertSame;
|
||||||
* @author Gail Badner
|
* @author Gail Badner
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractCollectionEventTest extends BaseCoreFunctionalTestCase {
|
public abstract class AbstractCollectionEventTest extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getBaseForMappings() {
|
||||||
|
return "org/hibernate/orm/test/";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void cleanupTest() {
|
protected void cleanupTest() {
|
||||||
ParentWithCollection dummyParent = createParent( "dummyParent" );
|
ParentWithCollection dummyParent = createParent( "dummyParent" );
|
||||||
|
@ -41,15 +48,19 @@ public abstract class AbstractCollectionEventTest extends BaseCoreFunctionalTest
|
||||||
inTransaction(
|
inTransaction(
|
||||||
s -> {
|
s -> {
|
||||||
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
||||||
|
List children;
|
||||||
|
if ( s.getFactory().getMetamodel().findEntityDescriptor( dummyChild.getClass() ) == null ) {
|
||||||
|
children = Collections.emptyList();
|
||||||
|
}
|
||||||
|
else {
|
||||||
CriteriaQuery<? extends Child> childrenCriteria = criteriaBuilder.createQuery( dummyChild.getClass() );
|
CriteriaQuery<? extends Child> childrenCriteria = criteriaBuilder.createQuery( dummyChild.getClass() );
|
||||||
childrenCriteria.from( dummyChild.getClass() );
|
childrenCriteria.from( dummyChild.getClass() );
|
||||||
List children = s.createQuery( childrenCriteria ).list();
|
children = s.createQuery( childrenCriteria ).list();
|
||||||
// List children = s.createCriteria( dummyChild.getClass() ).list();
|
}
|
||||||
|
|
||||||
CriteriaQuery<? extends ParentWithCollection> parentsCriteria = criteriaBuilder.createQuery( dummyParent.getClass() );
|
CriteriaQuery<? extends ParentWithCollection> parentsCriteria = criteriaBuilder.createQuery( dummyParent.getClass() );
|
||||||
childrenCriteria.from( dummyParent.getClass() );
|
parentsCriteria.from( dummyParent.getClass() );
|
||||||
List parents = s.createQuery( parentsCriteria ).list();
|
List parents = s.createQuery( parentsCriteria ).list();
|
||||||
// List parents = s.createCriteria( dummyParent.getClass() ).list();
|
|
||||||
for ( Iterator it = parents.iterator(); it.hasNext(); ) {
|
for ( Iterator it = parents.iterator(); it.hasNext(); ) {
|
||||||
ParentWithCollection parent = ( ParentWithCollection ) it.next();
|
ParentWithCollection parent = ( ParentWithCollection ) it.next();
|
||||||
parent.clearChildren();
|
parent.clearChildren();
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -19,8 +19,8 @@ import org.hibernate.Session;
|
||||||
import org.hibernate.Transaction;
|
import org.hibernate.Transaction;
|
||||||
import org.hibernate.collection.spi.PersistentCollection;
|
import org.hibernate.collection.spi.PersistentCollection;
|
||||||
import org.hibernate.event.spi.AbstractCollectionEvent;
|
import org.hibernate.event.spi.AbstractCollectionEvent;
|
||||||
import org.hibernate.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany;
|
import org.hibernate.orm.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany;
|
||||||
import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
||||||
import org.hibernate.testing.DialectChecks;
|
import org.hibernate.testing.DialectChecks;
|
||||||
import org.hibernate.testing.FailureExpected;
|
import org.hibernate.testing.FailureExpected;
|
||||||
import org.hibernate.testing.RequiresDialectFeature;
|
import org.hibernate.testing.RequiresDialectFeature;
|
||||||
|
@ -39,6 +39,13 @@ import static org.junit.Assert.assertSame;
|
||||||
*/
|
*/
|
||||||
@RequiresDialectFeature(DialectChecks.SupportsNoColumnInsert.class)
|
@RequiresDialectFeature(DialectChecks.SupportsNoColumnInsert.class)
|
||||||
public class BrokenCollectionEventTest extends BaseCoreFunctionalTestCase {
|
public class BrokenCollectionEventTest extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getBaseForMappings() {
|
||||||
|
return "org/hibernate/orm/test/";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getMappings() {
|
public String[] getMappings() {
|
||||||
return new String[] { "event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml" };
|
return new String[] { "event/collection/association/unidirectional/onetomany/UnidirectionalOneToManySetMapping.hbm.xml" };
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection;
|
package org.hibernate.orm.test.event.collection;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -4,17 +4,18 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.association;
|
package org.hibernate.orm.test.event.collection.association;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.Transaction;
|
import org.hibernate.Transaction;
|
||||||
import org.hibernate.dialect.AbstractHANADialect;
|
import org.hibernate.dialect.AbstractHANADialect;
|
||||||
import org.hibernate.test.event.collection.AbstractCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.AbstractCollectionEventTest;
|
||||||
import org.hibernate.test.event.collection.ChildEntity;
|
import org.hibernate.orm.test.event.collection.ChildEntity;
|
||||||
import org.hibernate.test.event.collection.CollectionListeners;
|
import org.hibernate.orm.test.event.collection.CollectionListeners;
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany;
|
import org.hibernate.orm.test.event.collection.association.bidirectional.manytomany.ChildWithBidirectionalManyToMany;
|
||||||
|
|
||||||
import org.hibernate.testing.SkipForDialect;
|
import org.hibernate.testing.SkipForDialect;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -4,12 +4,12 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.bidirectional.manytomany">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.bidirectional.manytomany">
|
||||||
|
|
||||||
<class name="ParentWithBidirectionalManyToMany" table="PARENT">
|
<class name="ParentWithBidirectionalManyToMany" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
|
@ -4,12 +4,12 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.bidirectional.manytomany">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.bidirectional.manytomany">
|
||||||
|
|
||||||
<class name="ParentWithBidirectionalManyToMany" table="PARENT">
|
<class name="ParentWithBidirectionalManyToMany" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
//$Id: $
|
//$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.Collection;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.ChildEntity;
|
import org.hibernate.orm.test.event.collection.ChildEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -7,13 +7,13 @@
|
||||||
|
|
||||||
//$Id: $
|
//$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.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.AbstractParentWithCollection;
|
import org.hibernate.orm.test.event.collection.AbstractParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -4,13 +4,13 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.bidirectional.onetomany">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.bidirectional.onetomany">
|
||||||
|
|
||||||
<class name="ParentWithBidirectionalOneToMany" table="PARENT">
|
<class name="ParentWithBidirectionalOneToMany" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
|
@ -4,9 +4,9 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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
|
* @author Gail Badner
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.bidirectional.onetomany">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.bidirectional.onetomany">
|
||||||
|
|
||||||
<class name="ParentWithBidirectionalOneToMany" table="PARENT" discriminator-value="P">
|
<class name="ParentWithBidirectionalOneToMany" table="PARENT" discriminator-value="P">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
|
@ -4,13 +4,13 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Gail Badner
|
* @author Gail Badner
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.bidirectional.onetomany">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.bidirectional.onetomany">
|
||||||
|
|
||||||
<class name="ParentWithBidirectionalOneToMany" table="PARENT">
|
<class name="ParentWithBidirectionalOneToMany" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
|
@ -7,9 +7,9 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
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.ChildEntity;
|
import org.hibernate.orm.test.event.collection.ChildEntity;
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Gail Badner
|
* @author Gail Badner
|
|
@ -7,12 +7,12 @@
|
||||||
|
|
||||||
//$Id: $
|
//$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.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.AbstractParentWithCollection;
|
import org.hibernate.orm.test.event.collection.AbstractParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -26,7 +26,7 @@ public class ParentWithBidirectionalOneToMany extends AbstractParentWithCollecti
|
||||||
super( name );
|
super( name );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Child createChild( String name ) {
|
public Child createChild(String name ) {
|
||||||
return new ChildWithManyToOne( name );
|
return new ChildWithManyToOne( name );
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection.association.bidirectional.onetomany;
|
package org.hibernate.orm.test.event.collection.association.bidirectional.onetomany;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection.association.unidirectional;
|
package org.hibernate.orm.test.event.collection.association.unidirectional;
|
||||||
import org.hibernate.test.event.collection.AbstractParentWithCollection;
|
import org.hibernate.orm.test.event.collection.AbstractParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
import org.hibernate.test.event.collection.ChildEntity;
|
import org.hibernate.orm.test.event.collection.ChildEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Gail Badner
|
* @author Gail Badner
|
|
@ -4,16 +4,16 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
import org.hibernate.test.event.collection.ChildEntity;
|
import org.hibernate.orm.test.event.collection.ChildEntity;
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
||||||
import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Gail Badner
|
* @author Gail Badner
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.unidirectional">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.unidirectional">
|
||||||
|
|
||||||
<class name="ParentWithCollectionOfEntities" table="PARENT">
|
<class name="ParentWithCollectionOfEntities" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
||||||
|
@ -22,11 +22,11 @@
|
||||||
<bag name="children" table="PARENT_CHILD"
|
<bag name="children" table="PARENT_CHILD"
|
||||||
inverse="false" cascade="all">
|
inverse="false" cascade="all">
|
||||||
<key column="parent_id"/>
|
<key column="parent_id"/>
|
||||||
<many-to-many column="child_id" class="org.hibernate.test.event.collection.ChildEntity"/>
|
<many-to-many column="child_id" class="org.hibernate.orm.test.event.collection.ChildEntity"/>
|
||||||
</bag>
|
</bag>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class name="org.hibernate.test.event.collection.ChildEntity" table="CHILD">
|
<class name="org.hibernate.orm.test.event.collection.ChildEntity" table="CHILD">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
||||||
<generator class="native"/>
|
<generator class="native"/>
|
||||||
</id>
|
</id>
|
|
@ -4,16 +4,16 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
import org.hibernate.test.event.collection.ChildEntity;
|
import org.hibernate.orm.test.event.collection.ChildEntity;
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
||||||
import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.unidirectional">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.unidirectional">
|
||||||
|
|
||||||
<class name="ParentWithCollectionOfEntities" table="PARENT">
|
<class name="ParentWithCollectionOfEntities" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
||||||
|
@ -22,11 +22,11 @@
|
||||||
<bag name="children"
|
<bag name="children"
|
||||||
cascade="all">
|
cascade="all">
|
||||||
<key column="parent_id"/>
|
<key column="parent_id"/>
|
||||||
<one-to-many class="org.hibernate.test.event.collection.ChildEntity"/>
|
<one-to-many class="org.hibernate.orm.test.event.collection.ChildEntity"/>
|
||||||
</bag>
|
</bag>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class name="org.hibernate.test.event.collection.ChildEntity" table="CHILD">
|
<class name="org.hibernate.orm.test.event.collection.ChildEntity" table="CHILD">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
||||||
<generator class="native"/>
|
<generator class="native"/>
|
||||||
</id>
|
</id>
|
|
@ -4,14 +4,14 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
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.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.association.AbstractAssociationCollectionEventTest;
|
||||||
import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
import org.hibernate.orm.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Gail Badner
|
* @author Gail Badner
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.association.unidirectional">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.association.unidirectional">
|
||||||
|
|
||||||
<class name="ParentWithCollectionOfEntities" table="PARENT">
|
<class name="ParentWithCollectionOfEntities" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
||||||
|
@ -22,11 +22,11 @@
|
||||||
<set name="children"
|
<set name="children"
|
||||||
cascade="all">
|
cascade="all">
|
||||||
<key column="parent_id"/>
|
<key column="parent_id"/>
|
||||||
<one-to-many class="org.hibernate.test.event.collection.ChildEntity"/>
|
<one-to-many class="org.hibernate.orm.test.event.collection.ChildEntity"/>
|
||||||
</set>
|
</set>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
<class name="org.hibernate.test.event.collection.ChildEntity" table="CHILD">
|
<class name="org.hibernate.orm.test.event.collection.ChildEntity" table="CHILD">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
||||||
<generator class="native"/>
|
<generator class="native"/>
|
||||||
</id>
|
</id>
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -4,14 +4,13 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Index;
|
import javax.persistence.Index;
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.JoinTable;
|
import javax.persistence.JoinTable;
|
||||||
import javax.persistence.ManyToMany;
|
import javax.persistence.ManyToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
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.PostCollectionRecreateEvent;
|
||||||
import org.hibernate.event.spi.PreCollectionRemoveEvent;
|
import org.hibernate.event.spi.PreCollectionRemoveEvent;
|
||||||
import org.hibernate.event.spi.PreCollectionUpdateEvent;
|
import org.hibernate.event.spi.PreCollectionUpdateEvent;
|
||||||
|
import org.hibernate.orm.test.event.collection.Entity;
|
||||||
|
|
||||||
import org.hibernate.testing.TestForIssue;
|
import org.hibernate.testing.TestForIssue;
|
||||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||||
|
@ -33,6 +34,11 @@ import static org.junit.Assert.assertSame;
|
||||||
@TestForIssue( jiraKey = "HHH-6361" )
|
@TestForIssue( jiraKey = "HHH-6361" )
|
||||||
public class DetachedMultipleCollectionChangeTest extends BaseCoreFunctionalTestCase {
|
public class DetachedMultipleCollectionChangeTest extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getBaseForMappings() {
|
||||||
|
return "org/hibernate/orm/test/";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getMappings() {
|
public String[] getMappings() {
|
||||||
return new String[] { "event/collection/detached/MultipleCollectionBagMapping.hbm.xml" };
|
return new String[] { "event/collection/detached/MultipleCollectionBagMapping.hbm.xml" };
|
||||||
|
@ -219,8 +225,8 @@ public class DetachedMultipleCollectionChangeTest extends BaseCoreFunctionalTest
|
||||||
protected void checkListener(
|
protected void checkListener(
|
||||||
MultipleCollectionListeners listeners,
|
MultipleCollectionListeners listeners,
|
||||||
MultipleCollectionListeners.Listener listenerExpected,
|
MultipleCollectionListeners.Listener listenerExpected,
|
||||||
org.hibernate.test.event.collection.Entity ownerExpected,
|
Entity ownerExpected,
|
||||||
List<? extends org.hibernate.test.event.collection.Entity> expectedCollectionEntrySnapshot,
|
List<? extends Entity> expectedCollectionEntrySnapshot,
|
||||||
int index) {
|
int index) {
|
||||||
AbstractCollectionEvent event = listeners
|
AbstractCollectionEvent event = listeners
|
||||||
.getEvents().get(index);
|
.getEvents().get(index);
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.detached">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.detached">
|
||||||
|
|
||||||
<class name="MultipleCollectionEntity" table="PARENT">
|
<class name="MultipleCollectionEntity" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -19,7 +19,7 @@ import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class MultipleCollectionEntity implements org.hibernate.test.event.collection.Entity {
|
public class MultipleCollectionEntity implements org.hibernate.orm.test.event.collection.Entity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -15,7 +15,7 @@ import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class MultipleCollectionRefEntity1 implements org.hibernate.test.event.collection.Entity {
|
public class MultipleCollectionRefEntity1 implements org.hibernate.orm.test.event.collection.Entity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.detached;
|
package org.hibernate.orm.test.event.collection.detached;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -15,7 +15,7 @@ import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class MultipleCollectionRefEntity2 implements org.hibernate.test.event.collection.Entity {
|
public class MultipleCollectionRefEntity2 implements org.hibernate.orm.test.event.collection.Entity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
//$Id: $
|
//$Id: $
|
||||||
|
|
||||||
package org.hibernate.test.event.collection.values;
|
package org.hibernate.orm.test.event.collection.values;
|
||||||
import org.hibernate.test.event.collection.AbstractParentWithCollection;
|
import org.hibernate.orm.test.event.collection.AbstractParentWithCollection;
|
||||||
import org.hibernate.test.event.collection.Child;
|
import org.hibernate.orm.test.event.collection.Child;
|
||||||
import org.hibernate.test.event.collection.ChildValue;
|
import org.hibernate.orm.test.event.collection.ChildValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -4,13 +4,13 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.collection.values;
|
package org.hibernate.orm.test.event.collection.values;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.hibernate.test.event.collection.AbstractCollectionEventTest;
|
import org.hibernate.orm.test.event.collection.AbstractCollectionEventTest;
|
||||||
import org.hibernate.test.event.collection.ParentWithCollection;
|
import org.hibernate.orm.test.event.collection.ParentWithCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
|
@ -9,7 +9,7 @@
|
||||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.event.collection.values">
|
<hibernate-mapping package="org.hibernate.orm.test.event.collection.values">
|
||||||
|
|
||||||
<class name="ParentWithCollectionOfValues" table="PARENT">
|
<class name="ParentWithCollectionOfValues" table="PARENT">
|
||||||
<id name="id" column="ID" type="long">
|
<id name="id" column="ID" type="long">
|
||||||
|
@ -18,11 +18,10 @@
|
||||||
<bag name="children"
|
<bag name="children"
|
||||||
cascade="all">
|
cascade="all">
|
||||||
<key column="parent_id"/>
|
<key column="parent_id"/>
|
||||||
<composite-element class="org.hibernate.test.event.collection.ChildValue">
|
<composite-element class="org.hibernate.orm.test.event.collection.ChildValue">
|
||||||
<property name="name"/>
|
<property name="name"/>
|
||||||
</composite-element>
|
</composite-element>
|
||||||
</bag>
|
</bag>
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
</hibernate-mapping>
|
</hibernate-mapping>
|
||||||
Pr
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.entity;
|
package org.hibernate.orm.test.event.entity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.event.entity;
|
package org.hibernate.orm.test.event.entity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.events;
|
package org.hibernate.orm.test.events;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.events;
|
package org.hibernate.orm.test.events;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.events;
|
package org.hibernate.orm.test.events;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.boot.Metadata;
|
import org.hibernate.boot.Metadata;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.events;
|
package org.hibernate.orm.test.events;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.events;
|
package org.hibernate.orm.test.events;
|
||||||
|
|
||||||
import org.hibernate.IrrelevantEntity;
|
import org.hibernate.IrrelevantEntity;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.events;
|
package org.hibernate.orm.test.events;
|
||||||
|
|
||||||
import org.hibernate.IrrelevantEntity;
|
import org.hibernate.IrrelevantEntity;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.eviction;
|
package org.hibernate.orm.test.eviction;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.eviction;
|
package org.hibernate.orm.test.eviction;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
|
@ -7,7 +7,7 @@
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE hibernate-mapping SYSTEM "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
|
<!DOCTYPE hibernate-mapping SYSTEM "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.exception" >
|
<hibernate-mapping package="org.hibernate.orm.test.exception" >
|
||||||
<class name="Group" table="T_GROUP" >
|
<class name="Group" table="T_GROUP" >
|
||||||
<id name="id" unsaved-value="null" column="group_id" >
|
<id name="id" unsaved-value="null" column="group_id" >
|
||||||
<generator class="native"/>
|
<generator class="native"/>
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id: Group.java 4746 2004-11-11 20:57:28Z steveebersole $
|
// $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;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* 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>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.exception;
|
package org.hibernate.orm.test.exception;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
|
@ -34,6 +34,13 @@ import static org.junit.Assert.fail;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase {
|
public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getBaseForMappings() {
|
||||||
|
return "org/hibernate/orm/test/";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getMappings() {
|
public String[] getMappings() {
|
||||||
return new String[] {"exception/User.hbm.xml", "exception/Group.hbm.xml"};
|
return new String[] {"exception/User.hbm.xml", "exception/Group.hbm.xml"};
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE hibernate-mapping SYSTEM "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
|
<!DOCTYPE hibernate-mapping SYSTEM "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.test.exception" >
|
<hibernate-mapping package="org.hibernate.orm.test.exception" >
|
||||||
<class name="User" table="T_USER" >
|
<class name="User" table="T_USER" >
|
||||||
<id name="id" unsaved-value="null" column="user_id" >
|
<id name="id" unsaved-value="null" column="user_id" >
|
||||||
<generator class="native"/>
|
<generator class="native"/>
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id: User.java 4746 2004-11-11 20:57:28Z steveebersole $
|
// $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.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
* 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
|
* 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 java.util.Collections;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
|
@ -12,4 +12,4 @@
|
||||||
* * EntityGraph
|
* * EntityGraph
|
||||||
* * fetch profile (?)
|
* * fetch profile (?)
|
||||||
*/
|
*/
|
||||||
package org.hibernate.test.fetch.runtime.managed;
|
package org.hibernate.orm.test.fetch.runtime.managed;
|
|
@ -20,6 +20,7 @@ import org.hibernate.StaleObjectStateException;
|
||||||
import org.hibernate.StaleStateException;
|
import org.hibernate.StaleStateException;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.engine.spi.SessionImplementor;
|
import org.hibernate.engine.spi.SessionImplementor;
|
||||||
|
import org.hibernate.jpa.QueryHints;
|
||||||
import org.hibernate.metamodel.MappingMetamodel;
|
import org.hibernate.metamodel.MappingMetamodel;
|
||||||
import org.hibernate.query.spi.QueryImplementor;
|
import org.hibernate.query.spi.QueryImplementor;
|
||||||
|
|
||||||
|
@ -1197,24 +1198,27 @@ public abstract class AbstractEntityWithOneToManyTest {
|
||||||
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
||||||
CriteriaQuery<Contract> criteria = criteriaBuilder.createQuery( Contract.class );
|
CriteriaQuery<Contract> criteria = criteriaBuilder.createQuery( Contract.class );
|
||||||
criteria.from( Contract.class );
|
criteria.from( Contract.class );
|
||||||
|
return s.createQuery( criteria )
|
||||||
QueryImplementor<Contract> query = s.createQuery( criteria );
|
.setHint( QueryHints.HINT_FETCHGRAPH, s.createEntityGraph( Contract.class ) )
|
||||||
query.setHint( "javax.persistence.fetchgraph", s.createEntityGraph( Contract.class) );
|
.uniqueResult();
|
||||||
return query.uniqueResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContractVariation getContractVariation(SessionImplementor s) {
|
private ContractVariation getContractVariation(SessionImplementor s) {
|
||||||
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
||||||
CriteriaQuery<ContractVariation> criteria = criteriaBuilder.createQuery( ContractVariation.class );
|
CriteriaQuery<ContractVariation> criteria = criteriaBuilder.createQuery( ContractVariation.class );
|
||||||
criteria.from( 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) {
|
private Party getParty(SessionImplementor s) {
|
||||||
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
CriteriaBuilder criteriaBuilder = s.getCriteriaBuilder();
|
||||||
CriteriaQuery<Party> criteria = criteriaBuilder.createQuery( Party.class );
|
CriteriaQuery<Party> criteria = criteriaBuilder.createQuery( Party.class );
|
||||||
criteria.from( 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) {
|
private void assertPartyAndContractAreDeleted(SessionImplementor s) {
|
||||||
|
|
Loading…
Reference in New Issue