Package javax.persistence

Examples of javax.persistence.ManyToMany.cascade()


          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  manyToManyAnn.cascade(), hibernateCascade, false, false
              )
          );
          collectionBinder.setOneToMany( false );
        }
        else if ( property.isAnnotationPresent( ManyToAny.class ) ) {
View Full Code Here


          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  manyToManyAnn.cascade(), hibernateCascade, false, false
              )
          );
          collectionBinder.setOneToMany( false );
        }
        else if ( property.isAnnotationPresent( ManyToAny.class ) ) {
View Full Code Here

          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  manyToManyAnn.cascade(), hibernateCascade, false, false
              )
          );
          collectionBinder.setOneToMany( false );
        }
        else if ( property.isAnnotationPresent( ManyToAny.class ) ) {
View Full Code Here

    assertAnnotationNotPresent( MapKeyJoinColumns.class );
    assertAnnotationNotPresent( MapKeyJoinColumn.class );
    assertAnnotationNotPresent( JoinTable.class );
    assertAnnotationNotPresent( Access.class );
    ManyToMany relAnno = reader.getAnnotation( ManyToMany.class );
    assertEquals( 0, relAnno.cascade().length );
    assertEquals( FetchType.LAZY, relAnno.fetch() );
    assertEquals( "", relAnno.mappedBy() );
    assertEquals( void.class, relAnno.targetEntity() );
  }
View Full Code Here

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

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

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

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

  public void testCascadeSomeWithDefaultPersist() throws Exception {
    reader = getReader( Entity2.class, "field1", "many-to-many.orm19.xml" );
    assertAnnotationPresent( ManyToMany.class );
    ManyToMany relAnno = reader.getAnnotation( ManyToMany.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

  public void testCascadeSomeWithDefaultPersist() throws Exception {
    reader = getReader( Entity2.class, "field1", "many-to-many.orm19.xml" );
    assertAnnotationPresent( ManyToMany.class );
    ManyToMany relAnno = reader.getAnnotation( ManyToMany.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

    reader = getReader( Entity2.class, "field1", "many-to-many.orm19.xml" );
    assertAnnotationPresent( ManyToMany.class );
    ManyToMany relAnno = reader.getAnnotation( ManyToMany.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

    assertAnnotationPresent( ManyToMany.class );
    ManyToMany relAnno = reader.getAnnotation( ManyToMany.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] );
  }

  /**
   * Make sure that it doesn't break the handler when {@link CascadeType#ALL}
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.