当前位置: 首页>>代码示例>>Java>>正文


Java AttributeOverride.column方法代码示例

本文整理汇总了Java中javax.persistence.AttributeOverride.column方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeOverride.column方法的具体用法?Java AttributeOverride.column怎么用?Java AttributeOverride.column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.persistence.AttributeOverride的用法示例。


在下文中一共展示了AttributeOverride.column方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAttributeOverride

import javax.persistence.AttributeOverride; //导入方法依赖的package包/类
private static Column getAttributeOverride(Class<?> type, String name) {
    AttributeOverride ao = type.getAnnotation(AttributeOverride.class);
    if (ao != null) {
        if (ao.name().equals(name)) {
            return ao.column();
        }
    }

    AttributeOverrides aos = type.getAnnotation(AttributeOverrides.class);
    if (aos != null) {
        for (AttributeOverride a : aos.value()) {
            if (a.name().equals(name)) {
                return a.column();
            }
        }
    }

    return null;
}
 
开发者ID:nortal,项目名称:petit,代码行数:20,代码来源:BeanMappingReflectionUtils.java

示例2: buildEmbeddedProperties

import javax.persistence.AttributeOverride; //导入方法依赖的package包/类
/**
 * Builds the embedded properties of this property.
 *
 * @param targetType
 *            the target type
 */
protected void buildEmbeddedProperties(final Class<?> targetType) {
	if (targetType.isAnnotationPresent(Embeddable.class)) {
		// Determine the access style
		final AccessStyle accessStyle;
		final Access accessType = targetType.getAnnotation(Access.class);
		if (accessType != null) {
			accessStyle = AccessStyle.getStyle(accessType.value());
		} else {
			accessStyle = getAttribute().getAccessStyle();
		}

		this.embeddedProperties = new ArrayList<>();
		this.requiredEmbeddedProperties = new ArrayList<>();
		final Map<String, AttributeOverride> attributeOverrides = EntityClass
				.getAttributeOverrides(getAttribute().getElement());
		final Map<String, AssociationOverride> accociationOverrides = EntityClass
				.getAccociationOverrides(getAttribute().getElement());
		for (final AttributeAccessor attribute : accessStyle.getDeclaredAttributes((Class<Object>) targetType,
				getAttribute().getImplementationClass())) {
			final AttributeOverride attributeOveride = attributeOverrides.get(attribute.getName());
			final Column columnMetadata = attributeOveride != null ? attributeOveride.column()
					: attribute.getAnnotation(Column.class);
			final AssociationOverride assocOverride = accociationOverrides.get(attribute.getName());
			final SingularProperty<T, ?> property = buildProperty(attribute, columnMetadata, assocOverride);
			if (property != null) {
				this.embeddedProperties.add(property);
				if (property.isRequired() && property instanceof EntityProperty) {
					this.requiredEmbeddedProperties.add((EntityProperty<T, ?>) property);
				}
			}
		}
	}
}
 
开发者ID:liefke,项目名称:org.fastnate,代码行数:40,代码来源:PluralProperty.java

示例3: getColumnAnnotation

import javax.persistence.AttributeOverride; //导入方法依赖的package包/类
private Column getColumnAnnotation(final AttributeAccessor attribute) {
	final AttributeOverride override = this.attributeOverrides.get(attribute.getName());
	return override != null ? override.column() : attribute.getAnnotation(Column.class);
}
 
开发者ID:liefke,项目名称:org.fastnate,代码行数:5,代码来源:EntityClass.java


注:本文中的javax.persistence.AttributeOverride.column方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。