Package javax.persistence

Examples of javax.persistence.OneToOne.targetEntity()


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

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

      if (rel != null)
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());

          // tmp.add(rel);
        }
View Full Code Here

          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

          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

    if (mTo != null) {
      return mTo.targetEntity();
    }
    final OneToOne oTo = property.getAnnotation( OneToOne.class );
    if (oTo != null) {
      return oTo.targetEntity();
    }
    throw new AssertionFailure("Unexpected discovery of a targetEntity: " + property.getName() );
  }
}
View Full Code Here

  public static Class<?> getSpecifiedLinkedType(final Field f) {
    final ManyToOne m = f.getAnnotation(ManyToOne.class);
    if (m != null && !m.targetEntity().equals(void.class))
      return m.targetEntity();
    final OneToOne m2 = f.getAnnotation(OneToOne.class);
    if (m2 != null && !m2.targetEntity().equals(void.class))
      return m2.targetEntity();

    return null;
  }
View Full Code Here

    final ManyToOne m = f.getAnnotation(ManyToOne.class);
    if (m != null && !m.targetEntity().equals(void.class))
      return m.targetEntity();
    final OneToOne m2 = f.getAnnotation(OneToOne.class);
    if (m2 != null && !m2.targetEntity().equals(void.class))
      return m2.targetEntity();

    return null;
  }

  @SuppressWarnings("unchecked")
View Full Code Here

    Field field = getMember();

    // One to One
    OneToOne oneToOne = field.getAnnotation(OneToOne.class);
    if (oneToOne != null) {
      Class<?> targetEntity = oneToOne.targetEntity();
      if (targetEntity != void.class) {
        return targetEntity;
      }
    }
View Full Code Here

    else {

      // One to One
      OneToOne oneToOne = method.getAnnotation(OneToOne.class);
      if (oneToOne != null) {
        Class<?> targetEntity = oneToOne.targetEntity();
        if (targetEntity != void.class) {
          return targetEntity;
        }
      }
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.