本文整理汇总了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;
}