Package javax.persistence

Examples of javax.persistence.ManyToMany.targetEntity()


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


    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() );
  }

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

    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

        if (annotations[k].annotationType().equals(javax.persistence.ManyToMany.class))
        {
          ManyToMany a = (ManyToMany) annotations[k];

          if (a.targetEntity().equals(""))
            throw new MissingTargetEntityException(beanName, methods[j].getName());

          rel = new Relationship(beanName);
          rel.setName(methods[j].getName());
View Full Code Here

          rel = new Relationship(beanName);
          rel.setName(methods[j].getName());

          rel.setFromMany(true);
          rel.setToMany(true);
          rel.setToBeanClassName(a.targetEntity().getCanonicalName());
          rel.setMappedBy(a.mappedBy());
        }

        if (annotations[k].annotationType().equals(javax.persistence.OneToOne.class))
        {
View Full Code Here

        if (annotations[k].annotationType().equals(javax.persistence.OneToOne.class))
        {
          OneToOne a = (OneToOne) annotations[k];

          if (a.targetEntity().equals(""))
            throw new MissingTargetEntityException(beanName, methods[j].getName());

          rel = new Relationship(beanName);
          rel.setName(methods[j].getName());
View Full Code Here

          rel = new Relationship(beanName);
          rel.setName(methods[j].getName());

          rel.setFromMany(false);
          rel.setToMany(false);
          rel.setToBeanClassName(a.targetEntity().getCanonicalName());
          rel.setMappedBy(a.mappedBy());
        }

        /**
         * Annotazioni relative alla generazione !!!!
View Full Code Here

        if (annotations[k].annotationType().equals(javax.persistence.ManyToMany.class))
        {
          ManyToMany a = (ManyToMany) annotations[k];

          if (a.targetEntity().equals(""))
            throw new MissingTargetEntityException(beanName, methods[j].getName());

          rel = new Relationship(beanName);
          rel.setName(methods[j].getName());
View Full Code Here

          rel = new Relationship(beanName);
          rel.setName(methods[j].getName());

          rel.setFromMany(true);
          rel.setToMany(true);
          rel.setToBeanClassName(a.targetEntity().getCanonicalName());
          rel.setMappedBy(a.mappedBy());
        }

        if (annotations[k].annotationType().equals(javax.persistence.OneToOne.class))
        {
View Full Code Here

        if (annotations[k].annotationType().equals(javax.persistence.OneToOne.class))
        {
          OneToOne a = (OneToOne) annotations[k];

          if (a.targetEntity().equals(""))
            throw new MissingTargetEntityException(beanName, methods[j].getName());

          rel = new Relationship(beanName);
          rel.setName(methods[j].getName());
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.