mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-24 21:07:26 +08:00
This commit is contained in:
parent
8520231bd4
commit
a13d55f34e
@ -76,6 +76,7 @@ public abstract class HqlQueryBase<A extends HqlQueryBase<A>> extends QueryBase<
|
||||
return expr.self();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public A forExample(Path.PEntity<?> entity, Map<String, Object> map) {
|
||||
select(entity).from(entity);
|
||||
try {
|
||||
@ -104,11 +105,13 @@ public abstract class HqlQueryBase<A extends HqlQueryBase<A>> extends QueryBase<
|
||||
return (A) this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public A limit(int limit) {
|
||||
this.limit = limit;
|
||||
return (A)this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public A offset(int offset) {
|
||||
this.offset = offset;
|
||||
return (A)this;
|
||||
|
||||
@ -5,10 +5,6 @@
|
||||
*/
|
||||
package com.mysema.query.hql;
|
||||
|
||||
import static com.mysema.query.grammar.Grammar.div;
|
||||
import static com.mysema.query.grammar.Grammar.sqrt;
|
||||
import static com.mysema.query.grammar.HqlGrammar.avg;
|
||||
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.Session;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -317,7 +317,7 @@ public class HqlParserTest extends QueryBaseWithDomain<HqlParserTest> {
|
||||
// + "group by ord\n"
|
||||
// + "having sum(price.amount) > :minAmount\n"
|
||||
// + "order by sum(price.amount) desc" );
|
||||
QCatalog cat = new QCatalog("cat");
|
||||
// QCatalog cat = new QCatalog("cat");
|
||||
select(ord.id, sum(price.amount), count(item))
|
||||
.from(ord).join(ord.lineItems.as(item))
|
||||
.join(item.product.as(product)).from(catalog)
|
||||
@ -386,7 +386,7 @@ public class HqlParserTest extends QueryBaseWithDomain<HqlParserTest> {
|
||||
// + " or payment.statusChanges[ maxIndex(payment.statusChanges) ].user <> :currentUser\n"
|
||||
// + "group by status.name, status.sortOrder\n"
|
||||
// + "order by status.sortOrder" );
|
||||
HqlDomain.User currentUser = new HqlDomain.User();
|
||||
// HqlDomain.User currentUser = new HqlDomain.User();
|
||||
|
||||
// select(count(payment), status.name)
|
||||
// .from(payment).join(payment.currentStatus.as(status))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user