當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。