Package org.squashtest.tm.domain.jpql

This package define the following extensions to the HQL language: group_concat : support for group_concat, if the underlying database supports something similar (eg stringagg for instance) s_sum : 'sum' over a subquery s_count : 'count(distinct ())' over a subquery s_avg : 'avg' over a subquery s_min : 'min' over a subquery s_max : 'max' over a subquery Note that here s_count has a semantic of 'count(distinct ...)'.

See: Description

Package org.squashtest.tm.domain.jpql Description

This package define the following extensions to the HQL language:

Note that here s_count has a semantic of 'count(distinct ...)'. Also the result type for the numeric aggregate functions will be a long : so don't use them if use them on float/double or you will be disappointed.

There extensions are available for Hibernate and QueryDSL. Note that if you want to use them in QueryDSL, you still need register them in the Hibernate SessionFactory first.

Hibernate

There are several dialect extensions defined in this package. They are helped by HibernateDialectExtensions, which contain more documentation

QueryDSL

Note : for them to work you need to use class ExtendedHibernateQuery instead of the regular HibernateQuery. Use the constructors immediately, there is no factory for it (and you don't need any actually).

The features are available both for the fluent API and the PathBuilder API.

For the PathBuilder API you may use new operators defined in ExtOps. Bits of documentation can be found in ExtOps, org.squashtest.tm.domain.jpql.SessionFactoryEnhancer.

For the fluent API:

. Examples :
querydsl expressiongenerated HQL
testCase.name.orderedGroupConcat(project.id, 'asc')
group_concat(testCase.name, 'order by', project.id, 'asc')
(assume subquery is 'select st.id from TestCase.steps st');
 mainquery.select(tc.name, subquery.s_avg())
select tc.name, s_avg((select st.id from TestCase.steps st))

Main documentation on that is in org.squashtest.tm.domain.jpql.SessionFactoryEnhancer.

Copyright © 2010–2016 Henix, henix.fr. All rights reserved.