當前位置: 首頁>>代碼示例>>Java>>正文


Java ManyToOne類代碼示例

本文整理匯總了Java中javax.persistence.ManyToOne的典型用法代碼示例。如果您正苦於以下問題:Java ManyToOne類的具體用法?Java ManyToOne怎麽用?Java ManyToOne使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ManyToOne類屬於javax.persistence包,在下文中一共展示了ManyToOne類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSerializeType

import javax.persistence.ManyToOne; //導入依賴的package包/類
@Override
public Optional<SerializeType> getSerializeType(BeanAttributeInformation attributeDesc) {
	Optional<OneToMany> oneToMany = attributeDesc.getAnnotation(OneToMany.class);
	if (oneToMany.isPresent()) {
		return toSerializeType(oneToMany.get().fetch());
	}
	Optional<ManyToOne> manyToOne = attributeDesc.getAnnotation(ManyToOne.class);
	if (manyToOne.isPresent()) {
		return toSerializeType(manyToOne.get().fetch());
	}
	Optional<ManyToMany> manyToMany = attributeDesc.getAnnotation(ManyToMany.class);
	if (manyToMany.isPresent()) {
		return toSerializeType(manyToMany.get().fetch());
	}
	Optional<ElementCollection> elementCollection = attributeDesc.getAnnotation(ElementCollection.class);
	if (elementCollection.isPresent()) {
		return toSerializeType(elementCollection.get().fetch());
	}
	return Optional.empty();
}
 
開發者ID:crnk-project,項目名稱:crnk-framework,代碼行數:21,代碼來源:JpaResourceFieldInformationProvider.java

示例2: findSerializer

import javax.persistence.ManyToOne; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public Object findSerializer(Annotated am) {
	if (am.hasAnnotation(ManyToOne.class)) {
		return new ManyToOneSerializer((Class<AbstractEntity>) am.getRawType());
	} else {
		return super.findDeserializer(am);
	}
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:10,代碼來源:HibernateAnnotationIntrospector.java

示例3: getTargetEntityClass

import javax.persistence.ManyToOne; //導入依賴的package包/類
private static Class<?> getTargetEntityClass(XProperty property) {
	final ManyToOne mTo = property.getAnnotation( ManyToOne.class );
	if (mTo != null) {
		return mTo.targetEntity();
	}
	final OneToOne oTo = property.getAnnotation( OneToOne.class );
	if (oTo != null) {
		return oTo.targetEntity();
	}
	throw new AssertionFailure("Unexpected discovery of a targetEntity: " + property.getName() );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:12,代碼來源:ToOneBinder.java

示例4: getCascadeTypes

import javax.persistence.ManyToOne; //導入依賴的package包/類
private CascadeType[] getCascadeTypes(AccessibleObject accessibleObject) {
    CascadeType[] cascadeTypes = null;
    if(accessibleObject.isAnnotationPresent(OneToMany.class)) {
        cascadeTypes = accessibleObject.getAnnotation(OneToMany.class).cascade();
    }else if(accessibleObject.isAnnotationPresent(ManyToOne.class)) {
        cascadeTypes = accessibleObject.getAnnotation(ManyToOne.class).cascade();
    }else if(accessibleObject.isAnnotationPresent(ManyToMany.class)) {
        cascadeTypes = accessibleObject.getAnnotation(ManyToMany.class).cascade();
    }
    return cascadeTypes;
}
 
開發者ID:chaokunyang,項目名稱:jkes,代碼行數:12,代碼來源:EventSupport.java

示例5: getCustomer

import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "customerNumber", nullable = false, insertable = false, updatable = false)
@JsonIgnore
public Customer getCustomer() {
        return this.customer;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:Payment.java

示例6: getVendor

import javax.persistence.ManyToOne; //導入依賴的package包/類
@JoinColumn(name="VENDORID")
@ManyToOne
public Vendor getVendor() {
    return vendor;
}
 
開發者ID:wwu-pi,項目名稱:tap17-muggl-javaee,代碼行數:6,代碼來源:VendorPart.java

示例7: getSchool

import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne
public School getSchool() {
	return school;
}
 
開發者ID:battlesteed,項目名稱:hibernateMaster,代碼行數:5,代碼來源:Clazz.java

示例8: getProduct

import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="productCode", nullable=false, insertable=false, updatable=false)
@JsonBackReference("order-product")
public Product getProduct() {
    return this.product;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:OrderDetail.java

示例9: getBreed

import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne
public Breed getBreed() { return breed; }
 
開發者ID:hibernate,項目名稱:hibernate-ogm-redis,代碼行數:3,代碼來源:Dog.java

示例10: getDiskInfo

import javax.persistence.ManyToOne; //導入依賴的package包/類
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public DiskInfo getDiskInfo() {
    return this.diskInfo;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:7,代碼來源:DiskInfo.java

示例11: getService

import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "service_id")
public QService getService() {
    return service;
}
 
開發者ID:bcgov,項目名稱:sbc-qsystem,代碼行數:6,代碼來源:QCustomer.java

示例12: getTaskInfo

import javax.persistence.ManyToOne; //導入依賴的package包/類
/** @return 外鍵,父任務. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public TaskInfo getTaskInfo() {
    return this.taskInfo;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:7,代碼來源:TaskInfo.java

示例13: getCompany

import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="cid", nullable=false)
public Company getCompany() {
    return this.company;
}
 
開發者ID:amritbhat786,項目名稱:DocIT,代碼行數:6,代碼來源:Department.java

示例14: getDepartment

import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="did")
public Department getDepartment() {
    return this.department;
}
 
開發者ID:amritbhat786,項目名稱:DocIT,代碼行數:6,代碼來源:Department.java

示例15: getSendsmsConfig

import javax.persistence.ManyToOne; //導入依賴的package包/類
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONFIG_ID")
public SendsmsConfig getSendsmsConfig() {
    return this.sendsmsConfig;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:7,代碼來源:SendsmsHistory.java


注:本文中的javax.persistence.ManyToOne類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。