@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(); }
@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); } }
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() ); }
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; }
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "customerNumber", nullable = false, insertable = false, updatable = false) @JsonIgnore public Customer getCustomer() { return this.customer; }
@JoinColumn(name="VENDORID") @ManyToOne public Vendor getVendor() { return vendor; }
@ManyToOne public School getSchool() { return school; }
@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="productCode", nullable=false, insertable=false, updatable=false) @JsonBackReference("order-product") public Product getProduct() { return this.product; }
@ManyToOne public Breed getBreed() { return breed; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PARENT_ID") public DiskInfo getDiskInfo() { return this.diskInfo; }
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "service_id") public QService getService() { return service; }
/** @return 外键,父任务. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PARENT_ID") public TaskInfo getTaskInfo() { return this.taskInfo; }
@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="cid", nullable=false) public Company getCompany() { return this.company; }
@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="did") public Department getDepartment() { return this.department; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "CONFIG_ID") public SendsmsConfig getSendsmsConfig() { return this.sendsmsConfig; }
@ManyToOne(fetch=FetchType.LAZY, optional=true) public Album getAlbum() {return album;}
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "CATALOG_ID") public TicketCatalog getTicketCatalog() { return this.ticketCatalog; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "INFO_ID") public TicketInfo getTicketInfo() { return this.ticketInfo; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "GROUP_ID") public TicketGroup getTicketGroup() { return this.ticketGroup; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "INFO_ID") public BookInfo getBookInfo() { return this.bookInfo; }
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") public QUser getUser() { return user; }
@ManyToOne(fetch=FetchType.EAGER, optional=false) public User getUser() {return user;}
@ManyToOne() @JoinColumn(name = "user_id", nullable = false, insertable = false, updatable = false) public QUser getUser() { return user; }
@ManyToOne @JoinColumn(name = "diretorio_pai") public Diretorio getDiretorioPai() { return diretorioPai; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PROCESS_ID") public BpmProcess getBpmProcess() { return this.bpmProcess; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "TEMPLATE_ID") public BpmMailTemplate getBpmMailTemplate() { return this.bpmMailTemplate; }
/** @return 外键,流程配置. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "CONF_BASE_ID") public BpmConfBase getBpmConfBase() { return this.bpmConfBase; }
/** * @return the phoneBasicInfo */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PhoneId", nullable = false) public PhoneBasicInfo getPhoneBasicInfo() { return phoneBasicInfo; }
@ManyToOne(fetch = FetchType.EAGER) public Funcionario getFuncionario() { return funcionario; }
/** @return 外键,配置节点. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "NODE_ID") public BpmConfNode getBpmConfNode() { return this.bpmConfNode; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "NODE_ID") public BpmConfNode getBpmConfNode() { return this.bpmConfNode; }
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "author", referencedColumnName = "id", nullable = true) public User getAuthor() { return author; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "INFO_ID") public ActivityInfo getActivityInfo() { return this.activityInfo; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "APP_ID") public WhitelistApp getWhitelistApp() { return this.whitelistApp; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "INFO_ID") public TemplateInfo getTemplateInfo() { return this.templateInfo; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "RULE_ID") public WorkcalRule getWorkcalRule() { return this.workcalRule; }
/** @return null. */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "TYPE_ID") public WorkcalType getWorkcalType() { return this.workcalType; }