Package javax.persistence

Examples of javax.persistence.OneToMany.cascade()


          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  oneToManyAnn.cascade(), hibernateCascade, oneToManyAnn.orphanRemoval(), false
              )
          );
          collectionBinder.setOneToMany( true );
        }
        else if ( elementCollectionAnn != null ) {
View Full Code Here


        collectionBinder.setFkJoinColumns( joinColumns );
        mappedBy = oneToManyAnn.mappedBy();
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
        );
        collectionBinder.setCascadeStrategy( getCascadeStrategy( oneToManyAnn.cascade(), hibernateCascade ) );
        collectionBinder.setOneToMany( true );
      }
      else if ( collectionOfElementsAnn != null ) {
        for ( Ejb3JoinColumn column : joinColumns ) {
          if ( column.isSecondary() ) {
View Full Code Here

          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  oneToManyAnn.cascade(), hibernateCascade, oneToManyAnn.orphanRemoval(), false
              )
          );
          collectionBinder.setOneToMany( true );
        }
        else if ( elementCollectionAnn != null
View Full Code Here

          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  oneToManyAnn.cascade(), hibernateCascade, oneToManyAnn.orphanRemoval(), false
              )
          );
          collectionBinder.setOneToMany( true );
        }
        else if ( elementCollectionAnn != null
View Full Code Here

          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  oneToManyAnn.cascade(), hibernateCascade, oneToManyAnn.orphanRemoval(), false
              )
          );
          collectionBinder.setOneToMany( true );
        }
        else if ( elementCollectionAnn != null ) {
View Full Code Here

          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  oneToManyAnn.cascade(), hibernateCascade, oneToManyAnn.orphanRemoval(), false
              )
          );
          collectionBinder.setOneToMany( true );
        }
        else if ( elementCollectionAnn != null
View Full Code Here

          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( oneToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  oneToManyAnn.cascade(), hibernateCascade, oneToManyAnn.orphanRemoval(), false
              )
          );
          collectionBinder.setOneToMany( true );
        }
        else if ( elementCollectionAnn != null
View Full Code Here

  public void testCascadeAll() throws Exception {
    reader = getReader( Entity2.class, "field1", "one-to-many.orm20.xml" );
    assertAnnotationPresent( OneToMany.class );
    OneToMany relAnno = reader.getAnnotation( OneToMany.class );
    assertEquals( 1, relAnno.cascade().length );
    assertEquals( CascadeType.ALL, relAnno.cascade()[0] );
  }

  public void testCascadeSomeWithDefaultPersist() throws Exception {
    reader = getReader( Entity2.class, "field1", "one-to-many.orm21.xml" );
View Full Code Here

  public void testCascadeAll() throws Exception {
    reader = getReader( Entity2.class, "field1", "one-to-many.orm20.xml" );
    assertAnnotationPresent( OneToMany.class );
    OneToMany relAnno = reader.getAnnotation( OneToMany.class );
    assertEquals( 1, relAnno.cascade().length );
    assertEquals( CascadeType.ALL, relAnno.cascade()[0] );
  }

  public void testCascadeSomeWithDefaultPersist() throws Exception {
    reader = getReader( Entity2.class, "field1", "one-to-many.orm21.xml" );
    assertAnnotationPresent( OneToMany.class );
View Full Code Here

  public void testCascadeSomeWithDefaultPersist() throws Exception {
    reader = getReader( Entity2.class, "field1", "one-to-many.orm21.xml" );
    assertAnnotationPresent( OneToMany.class );
    OneToMany relAnno = reader.getAnnotation( OneToMany.class );
    assertEquals( 4, relAnno.cascade().length );
    assertEquals( CascadeType.REMOVE, relAnno.cascade()[0] );
    assertEquals( CascadeType.REFRESH, relAnno.cascade()[1] );
    assertEquals( CascadeType.DETACH, relAnno.cascade()[2] );
    assertEquals( CascadeType.PERSIST, relAnno.cascade()[3] );
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.