当前位置: 首页>>代码示例>>Java>>正文


Java DetachedCriteria.addOrder方法代码示例

本文整理汇总了Java中org.hibernate.criterion.DetachedCriteria.addOrder方法的典型用法代码示例。如果您正苦于以下问题:Java DetachedCriteria.addOrder方法的具体用法?Java DetachedCriteria.addOrder怎么用?Java DetachedCriteria.addOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.criterion.DetachedCriteria的用法示例。


在下文中一共展示了DetachedCriteria.addOrder方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addWhere

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@Override
public void addWhere(ItemSerializerState state)
{
	ProjectionList projections = state.getItemProjection();
	DetachedCriteria criteria = state.getItemQuery();
	criteria.add(Restrictions.eq("uuid", uuid));
	criteria.addOrder(Order.asc(PROPERTY_VERSION));
	projections.add(Projections.property(PROPERTY_VERSION), ALIAS_VERSION);
}
 
开发者ID:equella,项目名称:Equella,代码行数:10,代码来源:AllVersionsWhereClause.java

示例2: getProductsByCreationDate

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
/**
 * Retrieve products ordered by it date of ingestion, updated.
 * The list of product is returned prior to the passed date argument.
 * Currently processed and locked products are not returned.
 *
 * @param max_date     Maximum date to retrieve products
 *                     More recent product will not be returned
 * @param max_products Maximum products to return
 * @return a scrollable list of the products
 */
@Transactional(readOnly = true)
public Iterator<Product> getProductsByCreationDate(Date max_date, int max_products)
{
   DetachedCriteria criteria = DetachedCriteria.forClass(Product.class);
   criteria.add(Restrictions.and(
         Restrictions.lt("created", max_date),
         Restrictions.and(
               Restrictions.eq("processed", true),
               Restrictions.eq("locked", false))));
   criteria.addOrder(Order.asc("created"));

   return productDao.listCriteria(criteria, 0, max_products).iterator();
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:24,代码来源:ProductService.java

示例3: addWhere

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@Override
public void addWhere(ItemSerializerState state)
{
	DetachedCriteria criteria = state.getItemQuery();
	ProjectionList projections = state.getItemProjection();
	criteria.add(Restrictions.eq("uuid", uuid));
	if( live )
	{
		criteria.add(Restrictions.eq("status", ItemStatus.LIVE.name()));
	}
	criteria.addOrder(Order.desc(PROPERTY_VERSION));
	projections.add(Projections.property(PROPERTY_VERSION), ALIAS_VERSION);
	state.setMaxResults(1);
}
 
开发者ID:equella,项目名称:Equella,代码行数:15,代码来源:LatestVersionWhereClause.java

示例4: loadDefinitions

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@DataProvider
public void loadDefinitions(Page<ReportDefinition> page,Criteria criteria){
	DetachedCriteria dc=this.buildDetachedCriteria(criteria, ReportDefinition.class);
	dc.addOrder(Order.desc("createDate"));
	this.pagingQuery(page, dc);
	IFileService fileService=ContextHolder.getBean(IFileService.BEAN_ID);
	for(ReportDefinition report:page.getEntities()){
		UploadDefinition uploadDefinition=fileService.getUploadDefinition(report.getReportFile());
		if(uploadDefinition!=null){
			report.setReportFileName(uploadDefinition.getFileName());
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:14,代码来源:ReportMaintain.java

示例5: findExcelModelDetailByModelId

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public List<ExcelModelDetail> findExcelModelDetailByModelId(String modelId) throws Exception {
	DetachedCriteria detachedCriteria = DetachedCriteria.forClass(ExcelModelDetail.class, "m");
	detachedCriteria.add(Restrictions.eq("excelModelId", modelId));
	detachedCriteria.addOrder(Order.asc("excelColumn"));
	List list = findByCriteria(detachedCriteria);
	return list;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:ExcelModelManager.java

示例6: loadComponentConfigsByName

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Collection<ComponentConfig> loadComponentConfigsByName(String profileKey) {
	DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
	dc.add(Restrictions.eq("name", profileKey));
	dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
	dc.addOrder(Order.asc("m.order"));
	return (List<ComponentConfig>) this.query(dc);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:HibernateComponentConfigManager.java

示例7: loadComponentConfig

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public ComponentConfig loadComponentConfig(String controlId, String name) {
	DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
	dc.add(Restrictions.eq("name", name));
	dc.add(Restrictions.eq("controlId", controlId));
	dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
	dc.addOrder(Order.asc("m.order"));
	List<ComponentConfig> componentConfigs = (List<ComponentConfig>) this.query(dc);
	return componentConfigs.isEmpty() ? null : componentConfigs.get(0);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:11,代码来源:HibernateComponentConfigManager.java

示例8: loadComponentConfigsByViewName

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Collection<ComponentConfig> loadComponentConfigsByViewName(String viewName) {
	DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
	dc.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
	dc.add(Restrictions.like("controlId", viewName + ".%"));
	dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
	dc.addOrder(Order.asc("m.order"));
	return (List<ComponentConfig>) this.query(dc);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:10,代码来源:HibernateComponentConfigManager.java

示例9: loadComponentConfigs

import org.hibernate.criterion.DetachedCriteria; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Collection<ComponentConfig> loadComponentConfigs() {
	DetachedCriteria dc = DetachedCriteria.forClass(ComponentConfig.class);
	dc.createAlias("componentConfigMembers", "m", CriteriaSpecification.LEFT_JOIN);
	dc.addOrder(Order.asc("m.order"));
	return (List<ComponentConfig>) this.query(dc);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:HibernateComponentConfigManager.java


注:本文中的org.hibernate.criterion.DetachedCriteria.addOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。