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


Java AttributeOverrides類代碼示例

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


AttributeOverrides類屬於javax.persistence包,在下文中一共展示了AttributeOverrides類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getId

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@EmbeddedId
@AttributeOverrides({
		@AttributeOverride(name = "RTableCatalog", column = @Column(name = "r_table_catalog")),
		@AttributeOverride(name = "RTableSchema", column = @Column(name = "r_table_schema")),
		@AttributeOverride(name = "RTableName", column = @Column(name = "r_table_name")),
		@AttributeOverride(name = "RRasterColumn", column = @Column(name = "r_raster_column")),
		@AttributeOverride(name = "srid", column = @Column(name = "srid")),
		@AttributeOverride(name = "scaleX", column = @Column(name = "scale_x", precision = 17, scale = 17)),
		@AttributeOverride(name = "scaleY", column = @Column(name = "scale_y", precision = 17, scale = 17)),
		@AttributeOverride(name = "blocksizeX", column = @Column(name = "blocksize_x")),
		@AttributeOverride(name = "blocksizeY", column = @Column(name = "blocksize_y")),
		@AttributeOverride(name = "sameAlignment", column = @Column(name = "same_alignment")),
		@AttributeOverride(name = "regularBlocking", column = @Column(name = "regular_blocking")),
		@AttributeOverride(name = "numBands", column = @Column(name = "num_bands")),
		@AttributeOverride(name = "pixelTypes", column = @Column(name = "pixel_types")),
		@AttributeOverride(name = "nodataValues", column = @Column(name = "nodata_values")),
		@AttributeOverride(name = "outDb", column = @Column(name = "out_db")),
		@AttributeOverride(name = "extent", column = @Column(name = "extent")) })
public RasterColumnsId getId() {
	return this.id;
}
 
開發者ID:AuScope,項目名稱:IGSN,代碼行數:22,代碼來源:RasterColumns.java

示例4: 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

示例5: getId

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@EmbeddedId
@AttributeOverrides({
		@AttributeOverride(name = "skuItem", column = @Column(name = "SKU_Item", length = 13)),
		@AttributeOverride(name = "upc", column = @Column(name = "UPC", length = 12)),
		@AttributeOverride(name = "sku", column = @Column(name = "SKU", length = 6)),
		@AttributeOverride(name = "itemNumber", column = @Column(name = "Item_Number", length = 6)),
		@AttributeOverride(name = "brand", column = @Column(name = "Brand", nullable = false, length = 45)),
		@AttributeOverride(name = "style", column = @Column(name = "Style", nullable = false, length = 45)),
		@AttributeOverride(name = "colorMap", column = @Column(name = "Color_Map", length = 45)),
		@AttributeOverride(name = "color", column = @Column(name = "Color", length = 45)),
		@AttributeOverride(name = "sizeMap", column = @Column(name = "Size_Map", length = 45)),
		@AttributeOverride(name = "size", column = @Column(name = "Size", length = 45)),
		@AttributeOverride(name = "sortSize", column = @Column(name = "Sort_Size", nullable = false)),
		@AttributeOverride(name = "inStock", column = @Column(name = "In_Stock", precision = 23, scale = 0)),
		@AttributeOverride(name = "material", column = @Column(name = "Material", nullable = false, length = 45)),
		@AttributeOverride(name = "shoeType", column = @Column(name = "Shoe_Type", nullable = false, length = 4)),
		@AttributeOverride(name = "description", column = @Column(name = "Description", nullable = false, length = 11)) })
public SkuShoeViewId getId() {
	return this.id;
}
 
開發者ID:VDuda,項目名稱:SyncRunner-Pub,代碼行數:21,代碼來源:SkuShoeView.java

示例6: 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

示例7: getId

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@EmbeddedId
@AttributeOverrides({
                @AttributeOverride(name = "customerNumber", column = @Column(name = "customerNumber", nullable = false)),
                @AttributeOverride(name = "checkNumber", column = @Column(name = "checkNumber", nullable = false, length = 50)) })
public PaymentId getId() {
        return this.id;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:Payment.java

示例8: getId

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@EmbeddedId

@AttributeOverrides( {
    @AttributeOverride(name="orderNumber", [email protected](name="orderNumber", nullable=false) ), 
    @AttributeOverride(name="productCode", [email protected](name="productCode", nullable=false, length=50) ) } )
public OrderDetailId getId() {
    return this.id;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:OrderDetail.java

示例9: 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

示例10: getId

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@EmbeddedId
@AttributeOverrides({
		@AttributeOverride(name = "refIdRecord1", column = @Column(name = "ref_id_record_1", nullable = false)),
		@AttributeOverride(name = "refIdRecord2", column = @Column(name = "ref_id_record_2", nullable = false)),
		@AttributeOverride(name = "refIdRelationType", column = @Column(name = "ref_id_relation_type", nullable = false)) })
public RelationsId getId() {
	return this.id;
}
 
開發者ID:regestaexe,項目名稱:bygle-ldp,代碼行數:9,代碼來源:Relations.java

示例11: getId

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@EmbeddedId
@AttributeOverrides({
		@AttributeOverride(name = "fkIdAccount", column = @Column(name = "fk_id_account", nullable = false)),
		@AttributeOverride(name = "fkIdAuthorities", column = @Column(name = "fk_id_authorities", nullable = false)) })
public UserAuthoritiesId getId() {
	return this.id;
}
 
開發者ID:dnbn,項目名稱:submerge,代碼行數:8,代碼來源:UserAuthorities.java

示例12: getDuration

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@Embedded
@AttributeOverrides({
        @AttributeOverride(name = "learner", column = @Column(name = "duration_learner")),
        @AttributeOverride(name = "eqOracle", column = @Column(name = "duration_eqOracle"))
})
public DetailedStatistics getDuration() {
    return duration;
}
 
開發者ID:LearnLib,項目名稱:alex,代碼行數:9,代碼來源:Statistics.java

示例13: getMqsUsed

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@Embedded
@AttributeOverrides({
        @AttributeOverride(name = "learner", column = @Column(name = "mqs_learner")),
        @AttributeOverride(name = "eqOracle", column = @Column(name = "mqs_eqOracle"))
})
public DetailedStatistics getMqsUsed() {
    return mqsUsed;
}
 
開發者ID:LearnLib,項目名稱:alex,代碼行數:9,代碼來源:Statistics.java

示例14: getSymbolsUsed

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@Embedded
@AttributeOverrides({
        @AttributeOverride(name = "learner", column = @Column(name = "symbolsUsed_learner")),
        @AttributeOverride(name = "eqOracle", column = @Column(name = "symbolsUsed_eqOracle"))
})
public DetailedStatistics getSymbolsUsed() {
    return symbolsUsed;
}
 
開發者ID:LearnLib,項目名稱:alex,代碼行數:9,代碼來源:Statistics.java

示例15: getId

import javax.persistence.AttributeOverrides; //導入依賴的package包/類
@EmbeddedId
@AttributeOverrides({
		@AttributeOverride(name = "studentId", column = @Column(name = "STUDENT_ID", nullable = false, precision = 5, scale = 0)),
		@AttributeOverride(name = "classesId", column = @Column(name = "CLASSES_ID", nullable = false, precision = 4, scale = 0)),
		@AttributeOverride(name = "status", column = @Column(name = "STU_CLASSES_STATUS", nullable = false, length = 1)) })

public StudentClassesId getId() {
	return this.id;
}
 
開發者ID:herlanijunior,項目名稱:sample-java-spring-genericdao,代碼行數:10,代碼來源:StudentClasses.java


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