当前位置: 首页>>代码示例>>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;未经允许,请勿转载。