This commit is contained in:
Timo Westkämper 2009-01-04 14:32:14 +00:00
parent 8520231bd4
commit a13d55f34e
3 changed files with 5 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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))