本文整理汇总了Java中javax.persistence.Access类的典型用法代码示例。如果您正苦于以下问题:Java Access类的具体用法?Java Access怎么用?Java Access使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Access类属于javax.persistence包,在下文中一共展示了Access类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAccessType
import javax.persistence.Access; //导入依赖的package包/类
private void getAccessType(List<Annotation> annotationList, Element element) {
if ( element == null ) {
return;
}
String access = element.attributeValue( "access" );
if ( access != null ) {
AnnotationDescriptor ad = new AnnotationDescriptor( Access.class );
AccessType type;
try {
type = AccessType.valueOf( access );
}
catch ( IllegalArgumentException e ) {
throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." );
}
if ( ( AccessType.PROPERTY.equals( type ) && this.element instanceof Method ) ||
( AccessType.FIELD.equals( type ) && this.element instanceof Field ) ) {
return;
}
ad.setValue( "value", type );
annotationList.add( AnnotationFactory.create( ad ) );
}
}
示例2: getId
import javax.persistence.Access; //导入依赖的package包/类
@Override
@Id
@Size(min = 16, max = 255)
@Access(value = AccessType.PROPERTY)
@Column(name = "token_data", nullable = false, length = 255)
public String getId() {
return id;
}
示例3: getId
import javax.persistence.Access; //导入依赖的package包/类
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "srva_event_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
return id;
}
示例4: getId
import javax.persistence.Access; //导入依赖的package包/类
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
return id;
}
示例5: determineClassDefinedAccessStrategy
import javax.persistence.Access; //导入依赖的package包/类
private AccessType determineClassDefinedAccessStrategy() {
AccessType classDefinedAccessType;
AccessType hibernateDefinedAccessType = AccessType.DEFAULT;
AccessType jpaDefinedAccessType = AccessType.DEFAULT;
org.hibernate.annotations.AccessType accessType = xClass.getAnnotation( org.hibernate.annotations.AccessType.class );
if ( accessType != null ) {
hibernateDefinedAccessType = AccessType.getAccessStrategy( accessType.value() );
}
Access access = xClass.getAnnotation( Access.class );
if ( access != null ) {
jpaDefinedAccessType = AccessType.getAccessStrategy( access.value() );
}
if ( hibernateDefinedAccessType != AccessType.DEFAULT
&& jpaDefinedAccessType != AccessType.DEFAULT
&& hibernateDefinedAccessType != jpaDefinedAccessType ) {
throw new MappingException(
"@AccessType and @Access specified with contradicting values. Use of @Access only is recommended. "
);
}
if ( hibernateDefinedAccessType != AccessType.DEFAULT ) {
classDefinedAccessType = hibernateDefinedAccessType;
}
else {
classDefinedAccessType = jpaDefinedAccessType;
}
return classDefinedAccessType;
}
示例6: getExplicitAccessType
import javax.persistence.Access; //导入依赖的package包/类
public AccessType getExplicitAccessType(XAnnotatedElement element) {
AccessType accessType = null;
AccessType hibernateAccessType = null;
AccessType jpaAccessType = null;
org.hibernate.annotations.AccessType accessTypeAnnotation = element.getAnnotation( org.hibernate.annotations.AccessType.class );
if ( accessTypeAnnotation != null ) {
hibernateAccessType = AccessType.getAccessStrategy( accessTypeAnnotation.value() );
}
Access access = element.getAnnotation( Access.class );
if ( access != null ) {
jpaAccessType = AccessType.getAccessStrategy( access.value() );
}
if ( hibernateAccessType != null && jpaAccessType != null && hibernateAccessType != jpaAccessType ) {
throw new MappingException(
"Found @Access and @AccessType with conflicting values on a property in class " + annotatedClass.toString()
);
}
if ( hibernateAccessType != null ) {
accessType = hibernateAccessType;
}
else if ( jpaAccessType != null ) {
accessType = jpaAccessType;
}
return accessType;
}
示例7: getDefaultAccess
import javax.persistence.Access; //导入依赖的package包/类
public AccessType getDefaultAccess() throws MappingException {
AccessType accessType = defaultAccess;
AccessType hibernateAccessType = AccessType.DEFAULT;
AccessType jpaAccessType = AccessType.DEFAULT;
org.hibernate.annotations.AccessType accessTypeAnnotation = property.getAnnotation( org.hibernate.annotations.AccessType.class );
if ( accessTypeAnnotation != null ) {
hibernateAccessType = AccessType.getAccessStrategy( accessTypeAnnotation.value() );
}
Access access = property.getAnnotation( Access.class );
if ( access != null ) {
jpaAccessType = AccessType.getAccessStrategy( access.value() );
}
if ( hibernateAccessType != AccessType.DEFAULT
&& jpaAccessType != AccessType.DEFAULT
&& hibernateAccessType != jpaAccessType ) {
StringBuilder builder = new StringBuilder();
builder.append( property.toString() );
builder.append(
" defines @AccessType and @Access with contradicting values. Use of @Access only is recommended."
);
throw new MappingException( builder.toString() );
}
if ( hibernateAccessType != AccessType.DEFAULT ) {
accessType = hibernateAccessType;
}
else if ( jpaAccessType != AccessType.DEFAULT ) {
accessType = jpaAccessType;
}
return accessType;
}
示例8: getId
import javax.persistence.Access; //导入依赖的package包/类
@Override
@Id
@Access(value = AccessType.PROPERTY)
@Column(name = "integration_id", nullable = false)
@Size(max = 255)
public String getId() {
return this.id;
}
示例9: getId
import javax.persistence.Access; //导入依赖的package包/类
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "announcement_subscriber_id", nullable = false)
public Long getId() {
return id;
}
示例10: getId
import javax.persistence.Access; //导入依赖的package包/类
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "announcement_id", nullable = false)
public Long getId() {
return id;
}
示例11: getId
import javax.persistence.Access; //导入依赖的package包/类
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = ID_COLUMN_NAME, nullable = false)
public Long getId() {
return this.id;
}
示例12: getId
import javax.persistence.Access; //导入依赖的package包/类
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "moose_data_card_import_id", nullable = false)
public Long getId() {
return id;
}
示例13: getId
import javax.persistence.Access; //导入依赖的package包/类
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "group_hunting_day_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
return id;
}
示例14: getId
import javax.persistence.Access; //导入依赖的package包/类
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "group_observation_rejection_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
return id;
}
示例15: getId
import javax.persistence.Access; //导入依赖的package包/类
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "group_harvest_rejection_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
return id;
}