當前位置: 首頁>>代碼示例>>Java>>正文


Java AttributeOverrides.value方法代碼示例

本文整理匯總了Java中javax.persistence.AttributeOverrides.value方法的典型用法代碼示例。如果您正苦於以下問題:Java AttributeOverrides.value方法的具體用法?Java AttributeOverrides.value怎麽用?Java AttributeOverrides.value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.persistence.AttributeOverrides的用法示例。


在下文中一共展示了AttributeOverrides.value方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: mergeAttributeOverrides

import javax.persistence.AttributeOverrides; //導入方法依賴的package包/類
/**
 * @param mergeWithAnnotations Whether to use Java annotations for this
 * element, if present and not disabled by the XMLContext defaults.
 * In some contexts (such as an association mapping) merging with
 * annotations is never allowed.
 */
private AttributeOverrides mergeAttributeOverrides(XMLContext.Default defaults, List<AttributeOverride> attributes, boolean mergeWithAnnotations) {
	if ( mergeWithAnnotations && defaults.canUseJavaAnnotations() ) {
		AttributeOverride annotation = getPhysicalAnnotation( AttributeOverride.class );
		addAttributeOverrideIfNeeded( annotation, attributes );
		AttributeOverrides annotations = getPhysicalAnnotation( AttributeOverrides.class );
		if ( annotations != null ) {
			for ( AttributeOverride current : annotations.value() ) {
				addAttributeOverrideIfNeeded( current, attributes );
			}
		}
	}
	if ( attributes.size() > 0 ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( AttributeOverrides.class );
		ad.setValue( "value", attributes.toArray( new AttributeOverride[attributes.size()] ) );
		return AnnotationFactory.create( ad );
	}
	else {
		return null;
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:27,代碼來源:JPAOverriddenAnnotationReader.java

示例2: getAttributeOverrides

import javax.persistence.AttributeOverrides; //導入方法依賴的package包/類
public static final AttributeOverride[] getAttributeOverrides(final AnnotatedElement ae) {
    AttributeOverride[] overrides = null;

    final AttributeOverrides aos = ae.getAnnotation(AttributeOverrides.class);
    if (aos != null) {
        overrides = aos.value();
    }

    if (overrides == null || overrides.length == 0) {
        final AttributeOverride override = ae.getAnnotation(AttributeOverride.class);
        if (override != null) {
            overrides = new AttributeOverride[1];
            overrides[0] = override;
        } else {
            overrides = new AttributeOverride[0];
        }
    }

    return overrides;
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:21,代碼來源:DbUtil.java

示例3: getAttributeOverride

import javax.persistence.AttributeOverrides; //導入方法依賴的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

示例4: getAttributeOverrides

import javax.persistence.AttributeOverrides; //導入方法依賴的package包/類
public static final AttributeOverride[] getAttributeOverrides(AnnotatedElement ae) {
    AttributeOverride[] overrides = null;

    AttributeOverrides aos = ae.getAnnotation(AttributeOverrides.class);
    if (aos != null) {
        overrides = aos.value();
    }

    if (overrides == null || overrides.length == 0) {
        AttributeOverride override = ae.getAnnotation(AttributeOverride.class);
        if (override != null) {
            overrides = new AttributeOverride[1];
            overrides[0] = override;
        } else {
            overrides = new AttributeOverride[0];
        }
    }

    return overrides;
}
 
開發者ID:apache,項目名稱:cloudstack,代碼行數:21,代碼來源:DbUtil.java

示例5: buildColumnOverride

import javax.persistence.AttributeOverrides; //導入方法依賴的package包/類
private static Map<String, Column[]> buildColumnOverride(XAnnotatedElement element, String path) {
	Map<String, Column[]> columnOverride = new HashMap<String, Column[]>();
	if ( element == null ) return columnOverride;
	AttributeOverride singleOverride = element.getAnnotation( AttributeOverride.class );
	AttributeOverrides multipleOverrides = element.getAnnotation( AttributeOverrides.class );
	AttributeOverride[] overrides;
	if ( singleOverride != null ) {
		overrides = new AttributeOverride[] { singleOverride };
	}
	else if ( multipleOverrides != null ) {
		overrides = multipleOverrides.value();
	}
	else {
		overrides = null;
	}

	//fill overridden columns
	if ( overrides != null ) {
		for (AttributeOverride depAttr : overrides) {
			columnOverride.put(
					StringHelper.qualify( path, depAttr.name() ),
					new Column[] { depAttr.column() }
			);
		}
	}
	return columnOverride;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:28,代碼來源:AbstractPropertyHolder.java


注:本文中的javax.persistence.AttributeOverrides.value方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。