当前位置: 首页>>代码示例>>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;未经允许,请勿转载。