AbstractFieldMetadataProvider.java 文件源码

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

项目:blcdemo 作者:
protected FieldInfo buildFieldInfo(Field field) {
    FieldInfo info = new FieldInfo();
    info.setName(field.getName());
    info.setGenericType(field.getGenericType());
    ManyToMany manyToMany = field.getAnnotation(ManyToMany.class);
    if (manyToMany != null) {
        info.setManyToManyMappedBy(manyToMany.mappedBy());
        info.setManyToManyTargetEntity(manyToMany.targetEntity().getName());
    }
    OneToMany oneToMany = field.getAnnotation(OneToMany.class);
    if (oneToMany != null) {
        info.setOneToManyMappedBy(oneToMany.mappedBy());
        info.setOneToManyTargetEntity(oneToMany.targetEntity().getName());
    }
    MapKey mapKey = field.getAnnotation(MapKey.class);
    if (mapKey != null) {
        info.setMapKey(mapKey.name());
    }
    return info;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号