EntityClass.java 文件源码

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

项目:org.fastnate 作者:
/**
 * Fills the {@link #properties}.
 *
 * @param c
 *            the currently inspected class
 * @param stopClass
 *            the class in the hierarchy to stop inspecting
 */
private void buildProperties(final Class<? super E> c, final Class<? super E> stopClass) {
    // Fill properties of super classes (at least until we find the joined parent class)
    if (c.getSuperclass() != null && c.getSuperclass() != stopClass) {
        buildProperties(c.getSuperclass(), stopClass);
    }

    // And now fill the properties of this class
    if (c.isAnnotationPresent(MappedSuperclass.class) || c.isAnnotationPresent(Entity.class)) {
        for (final AttributeAccessor field : this.accessStyle.getDeclaredAttributes(c, this.entityClass)) {
            if (!field.isAnnotationPresent(EmbeddedId.class) && !field.isAnnotationPresent(Id.class)) {
                final Property<E, ?> property = buildProperty(field, getColumnAnnotation(field),
                        this.associationOverrides.get(field.getName()));
                if (property != null) {
                    this.properties.put(field.getName(), property);
                    this.allProperties.add(property);
                    if (property instanceof SingularProperty) {
                        buildUniqueProperty((SingularProperty<E, ?>) property);
                    }
                }
            }
        }
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号