JpaMetaFilter.java 文件源码

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

项目:crnk-framework 作者:
private String getMappedBy(MetaAttribute attr) {
    ManyToMany manyManyAnnotation = attr.getAnnotation(ManyToMany.class);
    OneToMany oneManyAnnotation = attr.getAnnotation(OneToMany.class);
    OneToOne oneOneAnnotation = attr.getAnnotation(OneToOne.class);
    String mappedBy = null;
    if (manyManyAnnotation != null) {
        mappedBy = manyManyAnnotation.mappedBy();
    }
    if (oneManyAnnotation != null) {
        mappedBy = oneManyAnnotation.mappedBy();
    }
    if (oneOneAnnotation != null) {
        mappedBy = oneOneAnnotation.mappedBy();
    }

    if (mappedBy != null && mappedBy.length() == 0) {
        mappedBy = null;
    }
    return mappedBy;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号