當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。