Package javax.persistence

Examples of javax.persistence.OneToOne.cascade()


        }
        //MapsId means the columns belong to the pk => not null
        //@PKJC must be constrained
        final boolean mandatory = !ann.optional() || forcePersist || trueOneToOne;
        bindOneToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), forcePersist ),
            joinColumns,
            !mandatory,
            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
View Full Code Here


        }
        //MapsId means the columns belong to the pk => not null
        //@OneToOne with @PKJC can still be optional
        final boolean mandatory = !ann.optional() || forcePersist;
        bindOneToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), forcePersist ),
            joinColumns,
            !mandatory,
            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
View Full Code Here

        }
        //MapsId means the columns belong to the pk => not null
        //@PKJC must be constrained
        final boolean mandatory = !ann.optional() || forcePersist || trueOneToOne;
        bindOneToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), forcePersist ),
            joinColumns,
            !mandatory,
            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
View Full Code Here

        //MapsId means the columns belong to the pk => not null
        //@PKJC must be constrained
          final boolean mandatory = !ann.optional() || forcePersist || trueOneToOne;
       
        bindOneToOne(
            getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), forcePersist ),
            joinColumns,
            !mandatory,
            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
View Full Code Here

    assertAnnotationNotPresent( JoinColumns.class );
    assertAnnotationNotPresent( JoinColumn.class );
    assertAnnotationNotPresent( JoinTable.class );
    assertAnnotationNotPresent( Access.class );
    OneToOne relAnno = reader.getAnnotation( OneToOne.class );
    assertEquals( 0, relAnno.cascade().length );
    assertEquals( FetchType.EAGER, relAnno.fetch() );
    assertEquals( "", relAnno.mappedBy() );
    assertTrue( relAnno.optional() );
    assertFalse( relAnno.orphanRemoval() );
    assertEquals( void.class, relAnno.targetEntity() );
View Full Code Here

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

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

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

  public void testCascadeSomeWithDefaultPersist() throws Exception {
    reader = getReader( Entity1.class, "field1", "one-to-one.orm9.xml" );
    assertAnnotationPresent( OneToOne.class );
View Full Code Here

  public void testCascadeSomeWithDefaultPersist() throws Exception {
    reader = getReader( Entity1.class, "field1", "one-to-one.orm9.xml" );
    assertAnnotationPresent( OneToOne.class );
    OneToOne relAnno = reader.getAnnotation( OneToOne.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( Entity1.class, "field1", "one-to-one.orm9.xml" );
    assertAnnotationPresent( OneToOne.class );
    OneToOne relAnno = reader.getAnnotation( OneToOne.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( Entity1.class, "field1", "one-to-one.orm9.xml" );
    assertAnnotationPresent( OneToOne.class );
    OneToOne relAnno = reader.getAnnotation( OneToOne.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.