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


Java OrderBy类代码示例

本文整理汇总了Java中org.hibernate.annotations.OrderBy的典型用法代码示例。如果您正苦于以下问题:Java OrderBy类的具体用法?Java OrderBy怎么用?Java OrderBy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getProblemss

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
/**
 * Get the list of Problems
 */
// problemsPK
@OneToMany(mappedBy = "series", cascade = CascadeType.REMOVE)
@OrderBy(clause = "abbrev")
public List<Problems> getProblemss() {
    return this.problemss;
}
 
开发者ID:faramir,项目名称:ZawodyWeb,代码行数:10,代码来源:Series.java

示例2: getOrderProcesses

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@CollectionOfElements
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="purchaseOrder")
@OrderBy (
        clause = "id desc"
)
public Set<OrderProcessDTO> getOrderProcesses() {
    return this.orderProcesses;
}
 
开发者ID:maxdelo77,项目名称:replyit-master-3.2-final,代码行数:9,代码来源:OrderDTO.java

示例3: getPermissions

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "permission_role_map",
           joinColumns = {@JoinColumn(name = "role_id", updatable = false)},
           inverseJoinColumns = {@JoinColumn(name = "permission_id", updatable = false)}
)
@OrderBy(clause = "permission_id")
public Set<PermissionDTO> getPermissions() {
    return this.permissions;
}
 
开发者ID:maxdelo77,项目名称:replyit-master-3.2-final,代码行数:10,代码来源:RoleDTO.java

示例4: getAgeingEntitySteps

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "company")
@OrderBy(
        clause = "status_id"
)
public Set<AgeingEntityStepDTO> getAgeingEntitySteps() {
    return this.ageingEntitySteps;
}
 
开发者ID:maxdelo77,项目名称:replyit-master-3.2-final,代码行数:8,代码来源:CompanyDTO.java

示例5: getContactTypes

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "entity")
@OrderBy(
        clause = "id"
)
public Set<ContactTypeDTO> getContactTypes() {
    return this.contactTypes;
}
 
开发者ID:maxdelo77,项目名称:replyit-master-3.2-final,代码行数:8,代码来源:CompanyDTO.java

示例6: getValues

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER, mappedBy="enumeration")
@Cascade( 
        value= org.hibernate.annotations.CascadeType.DELETE_ORPHAN
        )
@Fetch (FetchMode.SUBSELECT)
@OrderBy(clause="id")
@Valid
public List<EnumerationValueDTO> getValues() {
    return this.values;
}
 
开发者ID:maxdelo77,项目名称:replyit-master-3.2-final,代码行数:11,代码来源:EnumerationDTO.java

示例7: getNotificationMessageSections

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "notificationMessage")
@OrderBy(clause = "section")
@Fetch(FetchMode.JOIN)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public Set<NotificationMessageSectionDTO> getNotificationMessageSections() {
    return this.notificationMessageSections;
}
 
开发者ID:maxdelo77,项目名称:replyit-master-3.2-final,代码行数:8,代码来源:NotificationMessageDTO.java

示例8: setJpaOrderBy

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
public void setJpaOrderBy(javax.persistence.OrderBy jpaOrderBy) {
	this.jpaOrderBy = jpaOrderBy;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:CollectionBinder.java

示例9: setSqlOrderBy

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
public void setSqlOrderBy(OrderBy sqlOrderBy) {
	this.sqlOrderBy = sqlOrderBy;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:CollectionBinder.java

示例10: applySortingAndOrdering

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
private void applySortingAndOrdering(Collection collection) {
	boolean isSorted = isSortedCollection;

	boolean hadOrderBy = false;
	boolean hadExplicitSort = false;

	Class<? extends Comparator> comparatorClass = null;

	if ( jpaOrderBy == null && sqlOrderBy == null ) {
		if ( deprecatedSort != null ) {
			LOG.debug( "Encountered deprecated @Sort annotation; use @SortNatural or @SortComparator instead." );
			if ( naturalSort != null || comparatorSort != null ) {
				throw buildIllegalSortCombination();
			}
			hadExplicitSort = deprecatedSort.type() != SortType.UNSORTED;
			if ( deprecatedSort.type() == SortType.NATURAL ) {
				isSorted = true;
			}
			else if ( deprecatedSort.type() == SortType.COMPARATOR ) {
				isSorted = true;
				comparatorClass = deprecatedSort.comparator();
			}
		}
		else if ( naturalSort != null ) {
			if ( comparatorSort != null ) {
				throw buildIllegalSortCombination();
			}
			hadExplicitSort = true;
		}
		else if ( comparatorSort != null ) {
			hadExplicitSort = true;
			comparatorClass = comparatorSort.value();
		}
	}
	else {
		if ( jpaOrderBy != null && sqlOrderBy != null ) {
			throw new AnnotationException(
					String.format(
							"Illegal combination of @%s and @%s on %s",
							javax.persistence.OrderBy.class.getName(),
							OrderBy.class.getName(),
							safeCollectionRole()
					)
			);
		}

		hadOrderBy = true;
		hadExplicitSort = false;

		// we can only apply the sql-based order by up front.  The jpa order by has to wait for second pass
		if ( sqlOrderBy != null ) {
			collection.setOrderBy( sqlOrderBy.clause() );
		}
	}

	if ( isSortedCollection ) {
		if ( ! hadExplicitSort && !hadOrderBy ) {
			throw new AnnotationException(
					"A sorted collection must define and ordering or sorting : " + safeCollectionRole()
			);
		}
	}

	collection.setSorted( isSortedCollection || hadExplicitSort );

	if ( comparatorClass != null ) {
		try {
			collection.setComparator( comparatorClass.newInstance() );
		}
		catch (Exception e) {
			throw new AnnotationException(
					String.format(
							"Could not instantiate comparator class [%s] for %s",
							comparatorClass.getName(),
							safeCollectionRole()
					)
			);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:81,代码来源:CollectionBinder.java

示例11: extractHqlOrderBy

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
private String extractHqlOrderBy(javax.persistence.OrderBy jpaOrderBy) {
	if ( jpaOrderBy != null ) {
		return jpaOrderBy.value(); // Null not possible. In case of empty expression, apply default ordering.
	}
	return null; // @OrderBy not found.
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:CollectionBinder.java

示例12: setSqlOrderBy

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@Override
public void setSqlOrderBy(OrderBy orderByAnn) {
	if ( orderByAnn != null )
		LOG.orderByAnnotationIndexedCollection();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:ListBinder.java

示例13: setSqlOrderBy

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@Override
   public void setSqlOrderBy(OrderBy orderByAnn) {
	if ( orderByAnn != null ) {
           super.setSqlOrderBy( orderByAnn );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:SetBinder.java

示例14: getLines

import org.hibernate.annotations.OrderBy; //导入依赖的package包/类
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="purchaseOrder")
@OrderBy(clause="id")
public List<OrderLineDTO> getLines() {
    return this.lines;
}
 
开发者ID:maxdelo77,项目名称:replyit-master-3.2-final,代码行数:6,代码来源:OrderDTO.java


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