private static boolean discoverTypeWithoutReflection(XProperty p) { if ( p.isAnnotationPresent( OneToOne.class ) && !p.getAnnotation( OneToOne.class ) .targetEntity() .equals( void.class ) ) { return true; } else if ( p.isAnnotationPresent( OneToMany.class ) && !p.getAnnotation( OneToMany.class ) .targetEntity() .equals( void.class ) ) { return true; } else if ( p.isAnnotationPresent( ManyToOne.class ) && !p.getAnnotation( ManyToOne.class ) .targetEntity() .equals( void.class ) ) { return true; } else if ( p.isAnnotationPresent( ManyToMany.class ) && !p.getAnnotation( ManyToMany.class ) .targetEntity() .equals( void.class ) ) { return true; } else if ( p.isAnnotationPresent( org.hibernate.annotations.Any.class ) ) { return true; } else if ( p.isAnnotationPresent( ManyToAny.class ) ) { if ( !p.isCollection() && !p.isArray() ) { throw new AnnotationException( "@ManyToAny used on a non collection non array property: " + p.getName() ); } return true; } else if ( p.isAnnotationPresent( Type.class ) ) { return true; } else if ( p.isAnnotationPresent( Target.class ) ) { return true; } return false; }
public XClass getPropertyClass() throws MappingException { if ( property.isAnnotationPresent( Target.class ) ) { return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() ); } else { return property.getType(); } }
public XClass getClassOrElement() throws MappingException { if ( property.isAnnotationPresent( Target.class ) ) { return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() ); } else { return property.getClassOrElementClass(); } }
@Embedded @Override @Target(DatePeriodImpl.class) public DatePeriod getValue() { return super.getValue(); }