当前位置: 首页>>代码示例>>Java>>正文


Java Access类代码示例

本文整理汇总了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 ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:JPAOverriddenAnnotationReader.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:EmailToken.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:SrvaEvent.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:ObservationContextSensitiveFields.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:33,代码来源:PropertyContainer.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:EntityBinder.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:PropertyInferredData.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:Integration.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:AnnouncementSubscriber.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:Announcement.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:HuntingClubArea.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:MooseDataCardImport.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:GroupHuntingDay.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:ObservationRejection.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:HarvestRejection.java


注:本文中的javax.persistence.Access类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。