Examples of targetEntity()


Examples of javax.persistence.ManyToMany.targetEntity()

    assertAnnotationPresent( Access.class );
    ManyToMany relAnno = reader.getAnnotation( ManyToMany.class );
    assertEquals( 0, relAnno.cascade().length );
    assertEquals( FetchType.EAGER, relAnno.fetch() );
    assertEquals( "field2", relAnno.mappedBy() );
    assertEquals( Entity3.class, relAnno.targetEntity() );
    assertEquals(
        AccessType.PROPERTY, reader.getAnnotation( Access.class )
        .value()
    );
  }
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

  }

  private static Class<?> getTargetEntityClass(XProperty property) {
    final ManyToOne mTo = property.getAnnotation( ManyToOne.class );
    if (mTo != null) {
      return mTo.targetEntity();
    }
    final OneToOne oTo = property.getAnnotation( OneToOne.class );
    if (oTo != null) {
      return oTo.targetEntity();
    }
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

  }

  private static Class<?> getTargetEntityClass(XProperty property) {
    final ManyToOne mTo = property.getAnnotation( ManyToOne.class );
    if (mTo != null) {
      return mTo.targetEntity();
    }
    final OneToOne oTo = property.getAnnotation( OneToOne.class );
    if (oTo != null) {
      return oTo.targetEntity();
    }
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

      bindManyToOne(
          getCascadeStrategy( ann.cascade(), hibernateCascade ),
          joinColumns,
          ann.optional(),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
          propertyHolder,
          inferredData, false, isIdentifierMapper, inSecondPass, mappings
      );
    }
    else if ( property.isAnnotationPresent( OneToOne.class ) ) {
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

          getCascadeStrategy( ann.cascade(), hibernateCascade ),
          joinColumns,
          ann.optional(),
          getFetchMode( ann.fetch() ),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
          propertyHolder,
          inferredData, ann.mappedBy(), trueOneToOne, isIdentifierMapper, inSecondPass, mappings
      );
    }
    else if ( property.isAnnotationPresent( org.hibernate.annotations.Any.class ) ) {
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

  }

  private static Class<?> getTargetEntityClass(XProperty property) {
    final ManyToOne mTo = property.getAnnotation( ManyToOne.class );
    if (mTo != null) {
      return mTo.targetEntity();
    }
    final OneToOne oTo = property.getAnnotation( OneToOne.class );
    if (oTo != null) {
      return oTo.targetEntity();
    }
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

          getCascadeStrategy( ann.cascade(), hibernateCascade ),
          joinColumns,
          ann.optional(),
          getFetchMode( ann.fetch() ),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
          propertyHolder,
          inferredData, ann.mappedBy(), trueOneToOne, isIdentifierMapper, inSecondPass, mappings
      );
    }
    else if ( property.isAnnotationPresent( OneToMany.class )
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

    Class<?> propertyType = field.getType();
   
    ManyToOne manyToOne = field.getAnnotation(ManyToOne.class);
   
    if (manyToOne != null){
      Class<?> tt = manyToOne.targetEntity();
     
      if (tt != null && !tt.equals(void.class)){
        propertyType = tt;
        logger.debug("target type" + tt);
      }
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

    assertAnnotationNotPresent( Access.class );
    ManyToOne relAnno = reader.getAnnotation( ManyToOne.class );
    assertEquals( 0, relAnno.cascade().length );
    assertEquals( FetchType.EAGER, relAnno.fetch() );
    assertTrue( relAnno.optional() );
    assertEquals( void.class, relAnno.targetEntity() );
  }

  /**
   * When there's a single join column, we still wrap it with a JoinColumns
   * annotation.
 
View Full Code Here

Examples of javax.persistence.ManyToOne.targetEntity()

    assertAnnotationPresent( Access.class );
    ManyToOne relAnno = reader.getAnnotation( ManyToOne.class );
    assertEquals( 0, relAnno.cascade().length );
    assertEquals( FetchType.LAZY, relAnno.fetch() );
    assertFalse( relAnno.optional() );
    assertEquals( Entity3.class, relAnno.targetEntity() );
    assertEquals( "col1", reader.getAnnotation( MapsId.class ).value() );
    assertEquals(
        AccessType.PROPERTY, reader.getAnnotation( Access.class )
        .value()
    );
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.