本文整理汇总了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;
}
示例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();
}
示例3: classHasFieldAccessType
private static boolean classHasFieldAccessType(final Class<?> type) {
final Access access = type.getAnnotation(Access.class);
return access != null && access.value() == AccessType.FIELD;
}
示例4: getParent
@ManyToOne(optional = true, targetEntity = MCRCategoryImpl.class)
@JoinColumn(name = "parentID")
@Access(AccessType.FIELD)
public MCRCategory getParent() {
return super.getParent();
}
示例5: getCreationDate
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
@Column(updatable = false)
@Access(AccessType.FIELD)
public Date getCreationDate() {
return creationDate;
}
示例6: getUpdatedDate
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
@Access(AccessType.FIELD)
public Date getUpdatedDate() {
return updatedDate;
}
示例7: resolveAccessTypeFromId
private AccessType resolveAccessTypeFromId(TypeElement source) {
// TODO: not implemented
return AccessType.FIELD;
}
示例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;
}