本文整理匯總了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;
}