Java 类org.hibernate.annotations.Target 实例源码

项目:lams    文件:PropertyContainer.java   
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;
}
项目:lams    文件:PropertyInferredData.java   
public XClass getPropertyClass() throws MappingException {
    if ( property.isAnnotationPresent( Target.class ) ) {
        return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() );
    }
    else {
        return property.getType();
    }
}
项目:lams    文件:PropertyInferredData.java   
public XClass getClassOrElement() throws MappingException {
    if ( property.isAnnotationPresent( Target.class ) ) {
        return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() );
    }
    else {
        return property.getClassOrElementClass();
    }
}
项目:sdcct    文件:DateResourceParamImpl.java   
@Embedded
@Override
@Target(DatePeriodImpl.class)
public DatePeriod getValue() {
    return super.getValue();
}