Java 类javax.persistence.ManyToOne 实例源码

项目:crnk-framework    文件:JpaResourceFieldInformationProvider.java   
@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();
}
项目:gitplex-mit    文件:HibernateAnnotationIntrospector.java   
@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);
    }
}
项目:lams    文件:ToOneBinder.java   
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() );
}
项目:jkes    文件:EventSupport.java   
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;
}
项目:GitHub    文件:Payment.java   
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "customerNumber", nullable = false, insertable = false, updatable = false)
@JsonIgnore
public Customer getCustomer() {
        return this.customer;
}
项目:tap17-muggl-javaee    文件:VendorPart.java   
@JoinColumn(name="VENDORID")
@ManyToOne
public Vendor getVendor() {
    return vendor;
}
项目:hibernateMaster    文件:Clazz.java   
@ManyToOne
public School getSchool() {
    return school;
}
项目:GitHub    文件:OrderDetail.java   
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="productCode", nullable=false, insertable=false, updatable=false)
@JsonBackReference("order-product")
public Product getProduct() {
    return this.product;
}
项目:hibernate-ogm-redis    文件:Dog.java   
@ManyToOne
public Breed getBreed() { return breed; }
项目:lemon    文件:DiskInfo.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public DiskInfo getDiskInfo() {
    return this.diskInfo;
}
项目:sbc-qsystem    文件:QCustomer.java   
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "service_id")
public QService getService() {
    return service;
}
项目:lemon    文件:TaskInfo.java   
/** @return 外键,父任务. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public TaskInfo getTaskInfo() {
    return this.taskInfo;
}
项目:DocIT    文件:Department.java   
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="cid", nullable=false)
public Company getCompany() {
    return this.company;
}
项目:DocIT    文件:Department.java   
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="did")
public Department getDepartment() {
    return this.department;
}
项目:lemon    文件:SendsmsHistory.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONFIG_ID")
public SendsmsConfig getSendsmsConfig() {
    return this.sendsmsConfig;
}
项目:aws-photosharing-example    文件:Share.java   
@ManyToOne(fetch=FetchType.LAZY, optional=true)
public Album getAlbum() {return album;}
项目:lemon    文件:TicketInfo.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CATALOG_ID")
public TicketCatalog getTicketCatalog() {
    return this.ticketCatalog;
}
项目:lemon    文件:TicketComment.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "INFO_ID")
public TicketInfo getTicketInfo() {
    return this.ticketInfo;
}
项目:lemon    文件:TicketMember.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "GROUP_ID")
public TicketGroup getTicketGroup() {
    return this.ticketGroup;
}
项目:lemon    文件:BookBorrow.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "INFO_ID")
public BookInfo getBookInfo() {
    return this.bookInfo;
}
项目:sbc-qsystem    文件:QCustomer.java   
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
public QUser getUser() {
    return user;
}
项目:aws-photosharing-example    文件:Share.java   
@ManyToOne(fetch=FetchType.EAGER, optional=false)
public User getUser() {return user;}
项目:sbc-qsystem    文件:QPlanService.java   
@ManyToOne()
@JoinColumn(name = "user_id", nullable = false, insertable = false, updatable = false)
public QUser getUser() {
    return user;
}
项目:photoiff    文件:Diretorio.java   
@ManyToOne
@JoinColumn(name = "diretorio_pai")
public Diretorio getDiretorioPai() {
    return diretorioPai;
}
项目:lemon    文件:BpmTaskDef.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PROCESS_ID")
public BpmProcess getBpmProcess() {
    return this.bpmProcess;
}
项目:lemon    文件:BpmTaskDefNotice.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TEMPLATE_ID")
public BpmMailTemplate getBpmMailTemplate() {
    return this.bpmMailTemplate;
}
项目:lemon    文件:BpmTaskDefNotice.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PROCESS_ID")
public BpmProcess getBpmProcess() {
    return this.bpmProcess;
}
项目:lemon    文件:BpmProcess.java   
/** @return 外键,流程配置. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONF_BASE_ID")
public BpmConfBase getBpmConfBase() {
    return this.bpmConfBase;
}
项目:sjk    文件:PhoneRelations.java   
/**
 * @return the phoneBasicInfo
 */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PhoneId", nullable = false)
public PhoneBasicInfo getPhoneBasicInfo() {
    return phoneBasicInfo;
}
项目:ponto-inteligente-api    文件:Lancamento.java   
@ManyToOne(fetch = FetchType.EAGER)
public Funcionario getFuncionario() {
    return funcionario;
}
项目:lemon    文件:BpmConfNotice.java   
/** @return 外键,配置节点. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "NODE_ID")
public BpmConfNode getBpmConfNode() {
    return this.bpmConfNode;
}
项目:lemon    文件:BpmConfCountersign.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "NODE_ID")
public BpmConfNode getBpmConfNode() {
    return this.bpmConfNode;
}
项目:QRcode-factory    文件:QrCode.java   
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "author", referencedColumnName = "id", nullable = true)
public User getAuthor() {
    return author;
}
项目:lemon    文件:BpmConfListener.java   
/** @return 外键,配置节点. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "NODE_ID")
public BpmConfNode getBpmConfNode() {
    return this.bpmConfNode;
}
项目:lemon    文件:ActivityUser.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "INFO_ID")
public ActivityInfo getActivityInfo() {
    return this.activityInfo;
}
项目:lemon    文件:BpmConfForm.java   
/** @return 外键,配置节点. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "NODE_ID")
public BpmConfNode getBpmConfNode() {
    return this.bpmConfNode;
}
项目:lemon    文件:WhitelistHost.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "APP_ID")
public WhitelistApp getWhitelistApp() {
    return this.whitelistApp;
}
项目:lemon    文件:TemplateField.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "INFO_ID")
public TemplateInfo getTemplateInfo() {
    return this.templateInfo;
}
项目:lemon    文件:WorkcalPart.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "RULE_ID")
public WorkcalRule getWorkcalRule() {
    return this.workcalRule;
}
项目:lemon    文件:WorkcalRule.java   
/** @return null. */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TYPE_ID")
public WorkcalType getWorkcalType() {
    return this.workcalType;
}