本文整理匯總了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();
}
示例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);
}
}
示例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() );
}
示例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;
}
示例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;
}
示例6: getVendor
import javax.persistence.ManyToOne; //導入依賴的package包/類
@JoinColumn(name="VENDORID")
@ManyToOne
public Vendor getVendor() {
return vendor;
}
示例7: getSchool
import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne
public School getSchool() {
return school;
}
示例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;
}
示例9: getBreed
import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne
public Breed getBreed() { return breed; }
示例10: getDiskInfo
import javax.persistence.ManyToOne; //導入依賴的package包/類
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public DiskInfo getDiskInfo() {
return this.diskInfo;
}
示例11: getService
import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "service_id")
public QService getService() {
return service;
}
示例12: getTaskInfo
import javax.persistence.ManyToOne; //導入依賴的package包/類
/** @return 外鍵,父任務. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public TaskInfo getTaskInfo() {
return this.taskInfo;
}
示例13: getCompany
import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="cid", nullable=false)
public Company getCompany() {
return this.company;
}
示例14: getDepartment
import javax.persistence.ManyToOne; //導入依賴的package包/類
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="did")
public Department getDepartment() {
return this.department;
}
示例15: getSendsmsConfig
import javax.persistence.ManyToOne; //導入依賴的package包/類
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONFIG_ID")
public SendsmsConfig getSendsmsConfig() {
return this.sendsmsConfig;
}