org.hibernate.test.cascade
Class BidirectionalOneToManyCascadeTest

java.lang.Object
  extended by org.hibernate.testing.junit4.BaseUnitTestCase
      extended by org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
          extended by org.hibernate.test.cascade.BidirectionalOneToManyCascadeTest

public class BidirectionalOneToManyCascadeTest
extends BaseCoreFunctionalTestCase

Test case to illustrate that when a delete-orphan cascade is used on a one-to-many collection and the many-to-one side is also cascaded a TransientObjectException is thrown. (based on annotations test case submitted by Edward Costello)


Nested Class Summary
 
Nested classes/interfaces inherited from class org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
BaseCoreFunctionalTestCase.RollbackWork
 
Field Summary
 
Fields inherited from class org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
DIALECT, NO_CLASSES, NO_MAPPINGS, USE_NEW_METADATA_MAPPINGS, VALIDATE_DATA_CLEANUP
 
Constructor Summary
BidirectionalOneToManyCascadeTest()
           
 
Method Summary
 String[] getMappings()
           
 void testSaveChildWithParent()
          Saves the child object with the parent when both the one-to-many and many-to-one associations use cascade="all"
 void testSaveOrphanDeleteChildWithParent()
          Saves the child object with the parent when the one-to-many association uses cascade="all-delete-orphan" and the many-to-one association uses cascade="all"
 void testSaveParentWithChild()
          Saves the parent object with a child when both the one-to-many and many-to-one associations use cascade="all"
 void testSaveParentWithOrphanDeleteChild()
          Saves the parent object with a child when the one-to-many association uses cascade="all-delete-orphan" and the many-to-one association uses cascade="all"
 
Methods inherited from class org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
addMappings, addMappings, afterConfigurationBuilt, afterConfigurationBuilt, afterSessionFactoryBuilt, afterTest, applyCacheSettings, assertAllDataRemoved, beforeTest, buildConfiguration, buildServiceRegistry, cleanupCache, cleanupTest, configuration, configure, constructConfiguration, createSchema, generateBootstrapRegistry, getAnnotatedClasses, getAnnotatedPackages, getBaseForMappings, getCacheConcurrencyStrategy, getDialect, getXmlFiles, onFailure, openSession, openSession, overrideCacheStrategy, prepareBasicRegistryBuilder, prepareBootstrapRegistryBuilder, prepareTest, readCommittedIsolationMaintained, rebuildSessionFactory, rebuildSessionFactoryOnError, serviceRegistry, sessionFactory
 
Methods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
releaseTransactions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BidirectionalOneToManyCascadeTest

public BidirectionalOneToManyCascadeTest()
Method Detail

getMappings

public String[] getMappings()
Overrides:
getMappings in class BaseCoreFunctionalTestCase

testSaveParentWithChild

public void testSaveParentWithChild()
Saves the parent object with a child when both the one-to-many and many-to-one associations use cascade="all"


testSaveChildWithParent

public void testSaveChildWithParent()
Saves the child object with the parent when both the one-to-many and many-to-one associations use cascade="all"


testSaveParentWithOrphanDeleteChild

public void testSaveParentWithOrphanDeleteChild()
Saves the parent object with a child when the one-to-many association uses cascade="all-delete-orphan" and the many-to-one association uses cascade="all"


testSaveOrphanDeleteChildWithParent

public void testSaveOrphanDeleteChildWithParent()
Saves the child object with the parent when the one-to-many association uses cascade="all-delete-orphan" and the many-to-one association uses cascade="all"



Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.