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


Java AccessType.FIELD屬性代碼示例

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


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

示例1: determineAccessTypeByIdPlacement

private static AccessType determineAccessTypeByIdPlacement(List<AnnotationInstance> idAnnotations) {
	AccessType accessType = null;
	for ( AnnotationInstance annotation : idAnnotations ) {
		AccessType tmpAccessType;
		if ( annotation.target() instanceof FieldInfo ) {
			tmpAccessType = AccessType.FIELD;
		}
		else if ( annotation.target() instanceof MethodInfo ) {
			tmpAccessType = AccessType.PROPERTY;
		}
		else {
			throw new AnnotationException( "Invalid placement of @Id annotation" );
		}

		if ( accessType == null ) {
			accessType = tmpAccessType;
		}
		else {
			if ( !accessType.equals( tmpAccessType ) ) {
				throw new AnnotationException( "Inconsistent placement of @Id annotation within hierarchy " );
			}
		}
	}
	return accessType;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:25,代碼來源:EntityHierarchyBuilder.java

示例2: getChildren

@Override
@OneToMany(targetEntity = MCRCategoryImpl.class,
    cascade = {
        CascadeType.ALL },
    mappedBy = "parent")
@OrderColumn(name = "positionInParent")
@Access(AccessType.FIELD)
public List<MCRCategory> getChildren() {
    return super.getChildren();
}
 
開發者ID:MyCoRe-Org,項目名稱:mycore,代碼行數:10,代碼來源:MCRCategoryImpl.java

示例3: classHasFieldAccessType

private static boolean classHasFieldAccessType(final Class<?> type) {
    final Access access = type.getAnnotation(Access.class);
    return access != null && access.value() == AccessType.FIELD;
}
 
開發者ID:suomenriistakeskus,項目名稱:oma-riista-web,代碼行數:4,代碼來源:JpaModelTest.java

示例4: getParent

@ManyToOne(optional = true, targetEntity = MCRCategoryImpl.class)
@JoinColumn(name = "parentID")
@Access(AccessType.FIELD)
public MCRCategory getParent() {
    return super.getParent();
}
 
開發者ID:MyCoRe-Org,項目名稱:mycore,代碼行數:6,代碼來源:MCRCategoryImpl.java

示例5: getCreationDate

@Temporal(javax.persistence.TemporalType.TIMESTAMP)
@Column(updatable = false)
@Access(AccessType.FIELD)
public Date getCreationDate() {
    return creationDate;
}
 
開發者ID:caratarse,項目名稱:caratarse-auth,代碼行數:6,代碼來源:Attribute.java

示例6: getUpdatedDate

@Temporal(javax.persistence.TemporalType.TIMESTAMP)
@Access(AccessType.FIELD)
public Date getUpdatedDate() {
    return updatedDate;
}
 
開發者ID:caratarse,項目名稱:caratarse-auth,代碼行數:5,代碼來源:Attribute.java

示例7: resolveAccessTypeFromId

private AccessType resolveAccessTypeFromId(TypeElement source) {
    // TODO: not implemented
    return AccessType.FIELD;
}
 
開發者ID:solita,項目名稱:query-utils,代碼行數:4,代碼來源:JpaMetamodel.java

示例8: getStyle

/**
 * Determines the correct mapping to the style for the given accesstype.
 *
 * @param type
 *            the access type as defined in an {@link Access} annotation.
 * @return the matching style
 */
public static AccessStyle getStyle(final AccessType type) {
	return type == AccessType.FIELD ? FIELD : METHOD;
}
 
開發者ID:liefke,項目名稱:org.fastnate,代碼行數:10,代碼來源:AccessStyle.java


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