PropertyContainer.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:lams 作者:
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;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号