Java 类javax.persistence.OrderBy 实例源码

项目:juddi    文件:ReplicationConfiguration.java   
/**
 * Gets the value of the serialNumber property.
 *
 */
@Column(name = "serialnumb")
@OrderBy(value = "SerialNumber DESC")
@Id
public Long getSerialNumber() {
        return serialNumber;
}
项目:lams    文件:JPAOverriddenAnnotationReader.java   
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 ) );
    }
}
项目:tianti    文件:User.java   
@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;
}
项目:java-course    文件:BlogEntry.java   
/**
 * 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;
}
项目:java-course    文件:BlogUser.java   
/**
 * 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;
}
项目:my-paper    文件:Member.java   
/**
 * 获取收藏商品
 * 
 * @return 收藏商品
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_member_favorite_product")
@OrderBy("createDate desc")
public Set<Product> getFavoriteProducts() {
    return favoriteProducts;
}
项目:my-paper    文件:ParameterGroup.java   
/**
 * 获取参数
 * 
 * @return 参数
 */
@JsonProperty
@Valid
@NotEmpty
@OneToMany(mappedBy = "parameterGroup", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OrderBy("order asc")
public List<Parameter> getParameters() {
    return parameters;
}
项目:my-paper    文件:Order.java   
/**
 * 获取订单项
 * 
 * @return 订单项
 */
@Valid
@NotEmpty
@OneToMany(mappedBy = "order", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OrderBy("isGift asc")
public List<OrderItem> getOrderItems() {
    return orderItems;
}
项目:my-paper    文件:ProductCategory.java   
/**
 * 获取筛选品牌
 * 
 * @return 筛选品牌
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_category_brand")
@OrderBy("order asc")
public Set<Brand> getBrands() {
    return brands;
}
项目:my-paper    文件:PaymentMethod.java   
/**
 * 获取支持配送方式
 * 
 * @return 支持配送方式
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_payment_shipping_method")
@OrderBy("order asc")
public Set<ShippingMethod> getShippingMethods() {
    return shippingMethods;
}
项目:my-paper    文件:Specification.java   
/**
 * 获取规格值
 * 
 * @return 规格值
 */
@Valid
@NotEmpty
@OneToMany(mappedBy = "specification", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OrderBy("order asc")
public List<SpecificationValue> getSpecificationValues() {
    return specificationValues;
}
项目:my-paper    文件:Article.java   
/**
 * 获取标签
 * 
 * @return 标签
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_article_tag")
@OrderBy("order asc")
public Set<Tag> getTags() {
    return tags;
}
项目:my-paper    文件:Product.java   
/**
 * 获取标签
 * 
 * @return 标签
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_tag")
@OrderBy("order asc")
public Set<Tag> getTags() {
    return tags;
}
项目:my-paper    文件:Product.java   
/**
 * 获取规格
 * 
 * @return 规格
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_specification")
@OrderBy("order asc")
public Set<Specification> getSpecifications() {
    return specifications;
}
项目:my-paper    文件:Product.java   
/**
 * 获取规格值
 * 
 * @return 规格值
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_specification_value")
@OrderBy("specification asc")
public Set<SpecificationValue> getSpecificationValues() {
    return specificationValues;
}
项目:SpringBBS    文件:AcctUser.java   
@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;
}
项目:SpringBBS    文件:AcctUser.java   
@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;
}
项目:alex    文件:Symbol.java   
/**
 * 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;
}
项目:alex    文件:LearnerResult.java   
/**
 * @return Get the steps of the result.
 */
@OneToMany(
        mappedBy = "result",
        orphanRemoval = true
)
@OrderBy("stepNo ASC")
public List<LearnerResultStep> getSteps() {
    return steps;
}
项目:eMonocot    文件:IdentificationKey.java   
/**
 * @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;
}
项目:eMonocot    文件:Concept.java   
/**
 * @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;
}
项目:eMonocot    文件:PhylogeneticTree.java   
@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;
}
项目:eMonocot    文件:Image.java   
@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;
}
项目:eMonocot    文件:Organisation.java   
/**
 * @return the jobs
 */
@JsonIgnore
@OneToMany(fetch = FetchType.LAZY, mappedBy = "organisation")
@Cascade(CascadeType.DELETE)
@OrderBy("lastHarvested DESC")
public Set<Resource> getResources() {
 return resources;
}
项目:eMonocot    文件:Taxon.java   
/**
 * @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;
}
项目:Project-H-Backend    文件:Haq.java   
/**
 * @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;
}
项目:powop    文件:Taxon.java   
/**
 * @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;
}
项目:omr    文件:QuestionnaireVO.java   
@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;
}
项目:omr    文件:QuestionnaireVO.java   
@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;
}
项目:omr    文件:QuestionnaireVO.java   
@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;
}
项目:omr    文件:QuestionnaireVO.java   
@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;
}
项目:omr    文件:QuestionnaireVO.java   
@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;
}
项目:ef-orm    文件:MetaHolder.java   
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;
}
项目:ef-orm    文件:MetaHolder.java   
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;
}
项目:juddi    文件:BusinessEntity.java   
@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;
}
项目:SelfSoftShop    文件:Admin.java   
@ManyToMany(fetch = FetchType.LAZY)
@JoinColumn(nullable = false)
@OrderBy("name asc")
@ForeignKey(name = "fk_admin_role_set")
public Set<Role> getRoleSet() {
    return roleSet;
}
项目:gesplan    文件:TecModel.java   
@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;
}
项目:gesplan    文件:TecModel.java   
@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;
}
项目:gesplan    文件:CapacRec.java   
@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;
}
项目:saos    文件:Judgment.java   
@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;
}