/** * Gets the value of the serialNumber property. * */ @Column(name = "serialnumb") @OrderBy(value = "SerialNumber DESC") @Id public Long getSerialNumber() { return serialNumber; }
private void getOrderBy(List<Annotation> annotationList, Element element) { Element subelement = element != null ? element.element( "order-by" ) : null; if ( subelement != null ) { AnnotationDescriptor ad = new AnnotationDescriptor( OrderBy.class ); copyStringElement( subelement, ad, "value" ); annotationList.add( AnnotationFactory.create( ad ) ); } }
@ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "org_user_role_rel", joinColumns = {@JoinColumn(name = "user_id")}, inverseJoinColumns = {@JoinColumn(name = "role_id")}) @Where(clause="delete_flag=0") @OrderBy("no") public Set<Role> getRoles() { return roles; }
/** * Get all comments for current blog entry. * * @return List of all comments for current blog entry. */ @OneToMany(mappedBy = "blogEntry", fetch = FetchType.LAZY, cascade = CascadeType.PERSIST, orphanRemoval = true) @OrderBy("postedOn") public List<BlogComment> getComments() { return comments; }
/** * Gets all blog entries for which current user is author. * * @return List of current user blog entries. */ @OneToMany(mappedBy = "creator", fetch = FetchType.LAZY, cascade = CascadeType.PERSIST, orphanRemoval = true) @OrderBy("createdAt") public List<BlogEntry> getEntries() { return entries; }
/** * 获取收藏商品 * * @return 收藏商品 */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "xx_member_favorite_product") @OrderBy("createDate desc") public Set<Product> getFavoriteProducts() { return favoriteProducts; }
/** * 获取参数 * * @return 参数 */ @JsonProperty @Valid @NotEmpty @OneToMany(mappedBy = "parameterGroup", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) @OrderBy("order asc") public List<Parameter> getParameters() { return parameters; }
/** * 获取订单项 * * @return 订单项 */ @Valid @NotEmpty @OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) @OrderBy("isGift asc") public List<OrderItem> getOrderItems() { return orderItems; }
/** * 获取筛选品牌 * * @return 筛选品牌 */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "xx_product_category_brand") @OrderBy("order asc") public Set<Brand> getBrands() { return brands; }
/** * 获取支持配送方式 * * @return 支持配送方式 */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "xx_payment_shipping_method") @OrderBy("order asc") public Set<ShippingMethod> getShippingMethods() { return shippingMethods; }
/** * 获取规格值 * * @return 规格值 */ @Valid @NotEmpty @OneToMany(mappedBy = "specification", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true) @OrderBy("order asc") public List<SpecificationValue> getSpecificationValues() { return specificationValues; }
/** * 获取标签 * * @return 标签 */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "xx_article_tag") @OrderBy("order asc") public Set<Tag> getTags() { return tags; }
/** * 获取标签 * * @return 标签 */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "xx_product_tag") @OrderBy("order asc") public Set<Tag> getTags() { return tags; }
/** * 获取规格 * * @return 规格 */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "xx_product_specification") @OrderBy("order asc") public Set<Specification> getSpecifications() { return specifications; }
/** * 获取规格值 * * @return 规格值 */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "xx_product_specification_value") @OrderBy("specification asc") public Set<SpecificationValue> getSpecificationValues() { return specificationValues; }
@ManyToMany @JoinTable(name = "user_badge", joinColumns = { @JoinColumn(name = "user_id") }, inverseJoinColumns = { @JoinColumn(name = "badge_id") }) @Fetch(FetchMode.SUBSELECT) @OrderBy("id") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public Set<Badge> getBadges() { return badges; }
@ManyToMany //�м����,��������Ĭ���������� @JoinTable(name = "ACCT_USER_ROLE", joinColumns = { @JoinColumn(name = "USER_ID") }, inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") }) //Fecth���Զ��� @Fetch(FetchMode.SUBSELECT) //���ϰ�id����. @OrderBy("id") //�����ж���id�Ļ���. @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public List<AcctRole> getRoleList() { return roleList; }
/** * Get the Actions related to the Symbol. * * @return The actions of this Symbol */ @OneToMany( mappedBy = "symbol", fetch = FetchType.LAZY, cascade = {CascadeType.ALL}) @OrderBy("number ASC") @JsonProperty public List<SymbolAction> getActions() { return actions; }
/** * @return Get the steps of the result. */ @OneToMany( mappedBy = "result", orphanRemoval = true ) @OrderBy("stepNo ASC") public List<LearnerResultStep> getSteps() { return steps; }
/** * @return the comments */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'IdentificationKey'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
/** * @return the comments */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'Concept'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'PhylogeneticTree'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'Image'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
/** * @return the jobs */ @JsonIgnore @OneToMany(fetch = FetchType.LAZY, mappedBy = "organisation") @Cascade(CascadeType.DELETE) @OrderBy("lastHarvested DESC") public Set<Resource> getResources() { return resources; }
/** * @return the comments */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'Taxon'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
/** * @return questions */ @OneToMany(fetch = FetchType.LAZY, mappedBy = "haq", cascade=CascadeType.ALL, orphanRemoval=true) @OrderBy("sortOrder") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public List<com.mobileman.projecth.domain.questionary.Question> getQuestions() { return this.questions; }
/** * @return a list of images of the taxon */ @ManyToMany(fetch = FetchType.LAZY, mappedBy = "taxa") @JsonSerialize(contentUsing = ImageSerializer.class) @OrderBy("rating DESC") public List<Image> getImages() { return images; }
@JazzProp(name="Questões",renderer=JazzRenderer.SUBMODULE,listable=false, searchable=false) @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER) @Size(min=1, message="Adicione pelo menos uma questão!") @NotEmpty(message="Adicione pelo menos uma questão!") @Valid() @Fetch(FetchMode.SELECT)//coloquei este fetch pq o hibernate vai multiplicar os resultados, por nao se tratar de um set. Estúpido! @OrderBy("ordem") public List<QuestionVO> getQuestions() { return questions; }
@JazzProp(name="Quest��es",renderer=JazzRenderer.SUBMODULE,listable=false, searchable=false) @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER) @Size(min=1, message="Adicione pelo menos uma quest�o!") @NotEmpty(message="Adicione pelo menos uma quest�o!") @Valid() @Fetch(FetchMode.SELECT)//coloquei este fetch pq o hibernate vai multiplicar os resultados, por nao se tratar de um set. Est�pido! @OrderBy("ordem") @Navigable(alias="perg",visitorClass=ShuffleQuestionsVisitor.class) public List<QuestionVO> getQuestions() { return questions; }
@JazzProp(name="Questões",renderer=JazzRenderer.SUBMODULE,listable=false, searchable=false) @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER) //@Column(nullable=true) retirei em 110611 nao faz sentido @Size(min=1, message="Adicione pelo menos uma questão!") @Valid @Fetch(FetchMode.SELECT)//coloquei este fetch pq o hibernate vai multiplicar os resultados, por nao se tratar de um set. Estúpido! @OrderBy("ordem") public List<QuestionVO> getQuestions() { return questions; }
private static JoinPath processJoin(AbstractMetadata thisMeta, ITableMetadata target, AnnotationProvider field, JoinColumn... jj) { List<JoinKey> result = new ArrayList<JoinKey>(); String fieldName = field.getName(); for (JoinColumn j : jj) { if (StringUtils.isBlank(j.name())) { throw new IllegalArgumentException("Invalid reference [" + thisMeta.getThisType().getName() + "." + fieldName + "]:The field 'name' in JoinColumn is empty"); } Field left = thisMeta.getField(j.name()); Assert.notNull(left, "Invalid reference [" + thisMeta.getThisType().getName() + "." + fieldName + "]: field [" + j.name() + "] not found from entity " + thisMeta.getThisType().getName()); Field right = target.getField(j.referencedColumnName()); if (right == null) { throw new NoResultException("Invalid reference [" + thisMeta.getThisType().getName() + "." + fieldName + "]: '" + j.referencedColumnName() + "' is not available in " + target.getThisType().getName()); } result.add(new JoinKey(left, right)); } JoinType type = JoinType.LEFT; JoinDescription joinDesc = field.getAnnotation(JoinDescription.class); if (joinDesc != null) { type = joinDesc.type(); } if (result.size() > 0) { JoinPath path = new JoinPath(type, result.toArray(new JoinKey[result.size()])); path.setDescription(joinDesc, field.getAnnotation(OrderBy.class)); if (joinDesc != null && joinDesc.filterCondition().length() > 0) { JoinKey joinExpress = getJoinExpress(thisMeta, target, joinDesc.filterCondition().trim()); if (joinExpress != null) path.addJoinKey(joinExpress); } return path; } return null; }
private static JoinPath processJoin(ITableMetadata meta, ITableMetadata target, AnnotationProvider annos, String mappedBy) { JoinDescription joinDesc = annos.getAnnotation(JoinDescription.class); OrderBy orderBy = annos.getAnnotation(OrderBy.class); List<JoinKey> result = new ArrayList<JoinKey>(); if (meta.getPKFields().size() != 1) { throw new IllegalArgumentException(meta.getSimpleName() + " cann't map to " + target.getSimpleName() + " since its primary key field count " + meta.getPKFields().size()); } Field left = meta.getPKFields().get(0).field(); Field right = target.getField(mappedBy); if (right == null) { throw new IllegalArgumentException(meta.getSimpleName() + " cann't map to " + target.getSimpleName() + " since there is no field [" + mappedBy + "] in target entity"); } result.add(new JoinKey(left, right)); JoinType type = JoinType.LEFT; if (joinDesc != null) { type = joinDesc.type(); } if (result.size() > 0) { JoinPath path = new JoinPath(type, result.toArray(new JoinKey[result.size()])); path.setDescription(joinDesc, orderBy); if (joinDesc != null && joinDesc.filterCondition().length() > 0) { JoinKey joinExpress = getJoinExpress(meta, target, joinDesc.filterCondition().trim()); if (joinExpress != null) path.addJoinKey(joinExpress); } return path; } return null; }
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity") @OrderBy public List<Contact> getContacts() { if (this.contacts==null) this.contacts = new ArrayList<Contact>(); return this.contacts; }
@ManyToMany(fetch = FetchType.LAZY) @JoinColumn(nullable = false) @OrderBy("name asc") @ForeignKey(name = "fk_admin_role_set") public Set<Role> getRoleSet() { return roleSet; }
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "TECIDO_ID", nullable = false) // name define o nome da chave estrangeira na tabela @OrderBy("codTecido") public Tecido getTecido() { return tecido; }
@ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "MODELO_ID", nullable = false) // name define o nome da chave estrangeira na tabela @OrderBy("codModelo") public Modelo getModelo() { return modelo; }
@ManyToOne /** n�o estou usando lazy pois quero os dados do perioPM sempre que mostrar capacRec */ @JoinColumn(name = "PERIOPM_ID", nullable = false) // name define o nome da chave estrangeira na tabela @OrderBy("periodoPM") public PerioPM getPerioPM() { return perioPM; }
@ElementCollection @CollectionTable(name="judgment_court_reporter", uniqueConstraints={@UniqueConstraint(name="judgment_court_reporter_unique", columnNames={"fk_judgment", "court_reporter"})}) @Column(name="court_reporter") @OrderBy("court_reporter") private List<String> getCourtReporters_() { return courtReporters; }