Replace Void type with wilcard where possible

This commit is contained in:
Timo Westkämper 2015-04-21 22:36:02 +03:00
parent 85e46b6a72
commit 70580c0cbe
72 changed files with 189 additions and 190 deletions

View File

@ -50,7 +50,7 @@ public abstract class AbstractQueryTest {
protected List<Integer> myInts = new ArrayList<Integer>();
protected TestQuery<Void> last;
protected TestQuery<?> last;
@Before
@ -68,7 +68,7 @@ public abstract class AbstractQueryTest {
return cats;
}
protected TestQuery<Void> query() {
protected TestQuery<?> query() {
last = new TestQuery<Void>();
return last;
}

View File

@ -12,7 +12,7 @@ public class ECJEvaluatorFactoryTest extends AbstractQueryTest {
CollQueryTemplates.DEFAULT,
new ECJEvaluatorFactory(getClass().getClassLoader()));
QueryEngine queryEngine = new DefaultQueryEngine(evaluatorFactory);
CollQuery<Void> query = new CollQuery<Void>(queryEngine);
CollQuery<?> query = new CollQuery<Void>(queryEngine);
query.from(cat, cats).select(cat.name).fetch();
}

View File

@ -54,7 +54,7 @@ public class JacocoTest {
}
CloneableKlasse vo = Alias.alias(CloneableKlasse.class, "vo");
assertNotNull(vo);
CollQuery<Void> query = new CollQuery<Void>();
CollQuery<?> query = new CollQuery<Void>();
final EntityPathBase<CloneableKlasse> fromVo = Alias.$(vo);
assertNotNull(fromVo);
query.from(fromVo, vos);

View File

@ -14,7 +14,7 @@ import com.querydsl.core.types.dsl.TimePath;
public class JodaTimeTemplatesTest {
private CollQuery<Void> query = new CollQuery<Void>(JodaTimeTemplates.DEFAULT);
private CollQuery<?> query = new CollQuery<Void>(JodaTimeTemplates.DEFAULT);
@Test
public void DateTime() {

View File

@ -49,7 +49,7 @@ public class OrderTest extends AbstractQueryTest {
@Test
public void With_count() {
CollQuery<Void> q = new CollQuery<Void>();
CollQuery<?> q = new CollQuery<Void>();
q.from(cat, cats);
long size = q.distinct().fetchCount();
assertTrue(size > 0);

View File

@ -60,8 +60,8 @@ public class PagingTest extends AbstractQueryTest {
assertEquals(size, IteratorAdapter.asList(createQuery(modifiers).select(var).iterate()).size());
}
private CollQuery<Void> createQuery(QueryModifiers modifiers) {
CollQuery<Void> query = new CollQuery<Void>().from(var, ints);
private CollQuery<?> createQuery(QueryModifiers modifiers) {
CollQuery<?> query = new CollQuery<Void>().from(var, ints);
if (modifiers != null) {
query.restrict(modifiers);
}

View File

@ -28,7 +28,7 @@ public class QueryMutabilityTest {
NoSuchMethodException, IllegalAccessException,
InvocationTargetException, IOException {
QCat cat = QCat.cat;
CollQuery<Void> query = new CollQuery<Void>();
CollQuery<?> query = new CollQuery<Void>();
query.from(cat, Collections.<Cat> emptyList());
new QueryMutability(query).test(cat.id, cat.name);

View File

@ -26,7 +26,7 @@ import com.querydsl.core.types.EntityPath;
* @author tiwe
*
*/
public class JDOQueryFactory implements QueryFactory<JDOQuery<Void>> {
public class JDOQueryFactory implements QueryFactory<JDOQuery<?>> {
private final Provider<PersistenceManager> persistenceManager;
@ -38,11 +38,11 @@ public class JDOQueryFactory implements QueryFactory<JDOQuery<Void>> {
return new JDODeleteClause(persistenceManager.get(), path);
}
public JDOQuery<Void> from(EntityPath<?> from) {
public JDOQuery<?> from(EntityPath<?> from) {
return query().from(from);
}
public JDOQuery<Void> query() {
public JDOQuery<?> query() {
return new JDOQuery<Void>(persistenceManager.get());
}

View File

@ -42,12 +42,12 @@ public abstract class AbstractJDOTest {
protected Transaction tx;
protected JDOQuery<Void> query() {
return new JDOQuery(pm, templates, false);
protected JDOQuery<?> query() {
return new JDOQuery<Void>(pm, templates, false);
}
protected JDOQuery<Void> detachedQuery() {
return new JDOQuery(pm, templates, true);
protected JDOQuery<?> detachedQuery() {
return new JDOQuery<Void>(pm, templates, true);
}
protected <T> List<T> query(EntityPath<T> source, Predicate condition) {

View File

@ -47,7 +47,7 @@ public class BasicsTest extends AbstractJDOTest {
@Test
public void Serialization() throws IOException{
JDOQuery<Void> query = query();
JDOQuery<?> query = query();
assertEquals("FROM com.querydsl.jdo.test.domain.Product", query.from(product).toString());
assertEquals("FROM com.querydsl.jdo.test.domain.Product" +
@ -60,7 +60,7 @@ public class BasicsTest extends AbstractJDOTest {
@Test
public void SubQuerySerialization() throws IOException{
JDOQuery<Void> query = query();
JDOQuery<?> query = query();
assertEquals("FROM com.querydsl.jdo.test.domain.Product", query.from(product).toString());
assertEquals("FROM com.querydsl.jdo.test.domain.Product" +
@ -114,7 +114,7 @@ public class BasicsTest extends AbstractJDOTest {
@Test
public void SimpleTest() throws IOException{
JDOQuery<Void> query = new JDOQuery<Void>(pm, templates, false);
JDOQuery<?> query = new JDOQuery<Void>(pm, templates, false);
assertEquals("Sony Discman", query.from(product).where(product.name.eq("Sony Discman"))
.select(product.name).fetchOne());
query.close();

View File

@ -34,7 +34,7 @@ import com.querydsl.jdo.test.domain.QStore;
public class FetchPlanTest extends AbstractJDOTest{
private JDOQuery<Void> query;
private JDOQuery<?> query;
@After
public void tearDown() {

View File

@ -44,7 +44,7 @@ public class JDOSQLQueryTest extends AbstractJDOTest{
private final SProduct product = SProduct.product;
protected JDOSQLQuery<Void> sql() {
protected JDOSQLQuery<?> sql() {
return new JDOSQLQuery<Void>(pm, sqlTemplates);
}

View File

@ -30,15 +30,15 @@ public class QueryMutabilityTest extends AbstractJDOTest{
IllegalArgumentException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException {
QProduct product = QProduct.product;
JDOQuery<Void> query = query().from(product);
JDOQuery<?> query = query().from(product);
new QueryMutability(query).test(product.name, product.description);
}
@Test
public void Clone() {
QProduct product = QProduct.product;
JDOQuery<Void> query = new JDOQuery<Void>().from(product).where(product.name.isNotNull());
JDOQuery<Void> query2 = query.clone(pm);
JDOQuery<?> query = new JDOQuery<Void>().from(product).where(product.name.isNotNull());
JDOQuery<?> query2 = query.clone(pm);
assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
query2.select(product).fetch();

View File

@ -21,7 +21,7 @@ import com.querydsl.jdo.JDOQuery;
public abstract class AbstractTest {
protected JDOQuery<Void> query() {
protected JDOQuery<?> query() {
return new JDOQuery<Void>();
}

View File

@ -26,7 +26,7 @@ import com.querydsl.core.types.Expression;
* @author tiwe
*
*/
public interface JPQLQueryFactory extends QueryFactory<JPQLQuery<Void>> {
public interface JPQLQueryFactory extends QueryFactory<JPQLQuery<?>> {
/**
* Create a new DELETE clause
@ -57,7 +57,7 @@ public interface JPQLQueryFactory extends QueryFactory<JPQLQuery<Void>> {
* @param from
* @return
*/
JPQLQuery<Void> from(EntityPath<?> from);
JPQLQuery<?> from(EntityPath<?> from);
/**
* Create a new UPDATE clause

View File

@ -59,7 +59,7 @@ public class HibernateQueryFactory implements JPQLQueryFactory {
return query().select(exprs);
}
public HibernateQuery<Void> from(EntityPath<?> from) {
public HibernateQuery<?> from(EntityPath<?> from) {
return query().from(from);
}
@ -67,7 +67,7 @@ public class HibernateQueryFactory implements JPQLQueryFactory {
return new HibernateUpdateClause(session.get(), path, templates);
}
public HibernateQuery<Void> query() {
public HibernateQuery<?> query() {
return new HibernateQuery<Void>(session.get(), templates);
}

View File

@ -66,7 +66,7 @@ public class JPAQueryFactory implements JPQLQueryFactory {
}
@Override
public JPAQuery<Void> from(EntityPath<?> from) {
public JPAQuery<?> from(EntityPath<?> from) {
return query().from(from);
}
@ -80,7 +80,7 @@ public class JPAQueryFactory implements JPQLQueryFactory {
}
@Override
public JPAQuery<Void> query() {
public JPAQuery<?> query() {
if (templates != null) {
return new JPAQuery<Void>(entityManager.get(), templates);
} else {

View File

@ -25,8 +25,8 @@ public class PackagelessEntityTest {
@SuppressWarnings("unchecked")
@Test
public void PackageLess_Path() {
JPAQuery<Void> query = new JPAQuery<Void>();
PathBuilder builder = new PathBuilder(PackagelessEntityTest.class,"entity");
JPAQuery<?> query = new JPAQuery<Void>();
PathBuilder<PackagelessEntityTest> builder = new PathBuilder(PackagelessEntityTest.class,"entity");
query.from(builder);
assertEquals("select entity\nfrom PackagelessEntityTest entity", query.toString());
}

View File

@ -91,11 +91,11 @@ public abstract class AbstractJPATest {
return Mode.target.get();
}
protected abstract JPQLQuery<Void> query();
protected abstract JPQLQuery<?> query();
protected abstract JPQLQuery<Void> testQuery();
protected abstract JPQLQuery<?> testQuery();
protected JPAQuery<Void> subQuery() {
protected JPAQuery<?> subQuery() {
return new JPAQuery<Void>();
}
@ -637,7 +637,7 @@ public abstract class AbstractJPATest {
public void Enum_In2() {
QEmployee employee = QEmployee.employee;
JPQLQuery<Void> query = query();
JPQLQuery<?> query = query();
query.from(employee).where(employee.lastName.eq("Smith"), employee.jobFunctions
.contains(JobFunction.CODER));
assertEquals(1l, query.fetchCount());
@ -1072,7 +1072,7 @@ public abstract class AbstractJPATest {
QEmployee employee = QEmployee.employee;
QUser user = QUser.user;
JPQLQuery<Void> query = query();
JPQLQuery<?> query = query();
query.from(employee);
query.innerJoin(employee.user, user);
query.select(employee).fetch();
@ -1285,7 +1285,7 @@ public abstract class AbstractJPATest {
QCompany company = QCompany.company;
StringExpression name = company.name;
Integer companyId = query().from(company).select(company.id).fetchFirst();
JPQLQuery<Void> query = query().from(company).where(company.id.eq(companyId));
JPQLQuery<?> query = query().from(company).where(company.id.eq(companyId));
String str = query.select(company.name).fetchFirst();
assertEquals(Integer.valueOf(29),

View File

@ -21,11 +21,11 @@ import com.querydsl.jpa.impl.JPAQuery;
public abstract class AbstractQueryTest implements Constants {
protected QueryHelper<Void> query() {
protected QueryHelper<?> query() {
return new QueryHelper<Void>(HQLTemplates.DEFAULT);
}
protected JPAQuery<Void> sub() {
protected JPAQuery<?> sub() {
return new JPAQuery<Void>();
}

View File

@ -42,7 +42,7 @@ public abstract class AbstractSQLTest {
}
protected SQLQuery<Void> sq() {
protected SQLQuery<?> sq() {
return new SQLQuery<Void>();
}

View File

@ -53,12 +53,12 @@ public class HibernateBase extends AbstractJPATest implements HibernateTest {
private Session session;
@Override
protected HibernateQuery<Void> query() {
protected HibernateQuery<?> query() {
return new HibernateQuery<Void>(session, getTemplates());
}
@Override
protected HibernateQuery<Void> testQuery() {
protected HibernateQuery<?> testQuery() {
return new HibernateQuery<Void>(new DefaultSessionHolder(session),
getTemplates(), new DefaultQueryMetadata());
}

View File

@ -34,7 +34,7 @@ public class HibernateQueryMutabilityTest implements HibernateTest {
private Session session;
protected HibernateQuery<Void> query() {
protected HibernateQuery<?> query() {
return new HibernateQuery<Void>(session);
}
@ -48,15 +48,15 @@ public class HibernateQueryMutabilityTest implements HibernateTest {
NoSuchMethodException, IllegalAccessException,
InvocationTargetException, IOException {
QCat cat = QCat.cat;
HibernateQuery<Void> query = query().from(cat);
HibernateQuery<?> query = query().from(cat);
new QueryMutability(query).test(cat, cat.name);
}
@Test
public void Clone() {
QCat cat = QCat.cat;
HibernateQuery<Void> query = query().from(cat).where(cat.name.isNotNull());
HibernateQuery<Void> query2 = query.clone(session);
HibernateQuery<?> query = query().from(cat).where(cat.name.isNotNull());
HibernateQuery<?> query2 = query.clone(session);
assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
query2.select(cat).fetch();

View File

@ -30,15 +30,14 @@ public class HibernateQueryTest {
public void Clone() {
QCat cat = QCat.cat;
BooleanBuilder emptyBooleanBuilder = new BooleanBuilder();
HibernateQuery<Void> hq = new HibernateQuery<Void>().from(cat).where(cat.name.isNull().and(emptyBooleanBuilder));
HibernateQuery<Void> hq2 = hq.clone();
HibernateQuery<?> hq = new HibernateQuery<Void>().from(cat).where(cat.name.isNull().and(emptyBooleanBuilder));
HibernateQuery<?> hq2 = hq.clone();
assertNotNull(hq2);
}
@Test
public void InnerJoin() {
HibernateQuery<Void> hqlQuery = new HibernateQuery<Void>();
HibernateQuery<?> hqlQuery = new HibernateQuery<Void>();
QEmployee employee = QEmployee.employee;
hqlQuery.from(employee);
hqlQuery.innerJoin(employee.user, QUser.user);

View File

@ -46,7 +46,7 @@ public class HibernateSQLBase extends AbstractSQLTest implements HibernateTest {
private Session session;
@Override
protected HibernateSQLQuery<Void> query() {
protected HibernateSQLQuery<?> query() {
return new HibernateSQLQuery<Void>(session, templates);
}

View File

@ -43,7 +43,7 @@ public class IntegrationBase extends ParsingTest implements HibernateTest {
private Session session;
@Override
protected QueryHelper<Void> query() {
protected QueryHelper<?> query() {
return new QueryHelper<Void>(HQLTemplates.DEFAULT) {
@Override
public void parse() throws RecognitionException, TokenStreamException {
@ -102,7 +102,7 @@ public class IntegrationBase extends ParsingTest implements HibernateTest {
session.save(new Cat("Steve",11));
QCat cat = QCat.cat;
HibernateQuery<Void> query = new HibernateQuery<Void>(session);
HibernateQuery<?> query = new HibernateQuery<Void>(session);
ScrollableResults results = query.from(cat).select(cat).scroll(ScrollMode.SCROLL_INSENSITIVE);
while (results.next()) {
System.out.println(results.get(0));

View File

@ -61,7 +61,7 @@ public class JPABase extends AbstractJPATest implements JPATest {
private EntityManager entityManager;
@Override
protected JPAQuery<Void> query() {
protected JPAQuery<?> query() {
return new JPAQuery<Void>(entityManager);
}
@ -70,7 +70,7 @@ public class JPABase extends AbstractJPATest implements JPATest {
}
@Override
protected JPAQuery<Void> testQuery() {
protected JPAQuery<?> testQuery() {
return new JPAQuery<Void>(entityManager, new DefaultQueryMetadata());
}
@ -131,7 +131,7 @@ public class JPABase extends AbstractJPATest implements JPATest {
QChild child = QChild.child;
QParent parent = QParent.parent;
JPAQuery<Void> subQuery = new JPAQuery<Void>()
JPAQuery<?> subQuery = new JPAQuery<Void>()
.from(parent)
.where(parent.id.eq(2),
child.parent.eq(parent));

View File

@ -41,7 +41,7 @@ public class JPAIntegrationBase extends ParsingTest implements JPATest {
private JPQLTemplates templates;
@Override
protected QueryHelper<Void> query() {
protected QueryHelper<?> query() {
return new QueryHelper<Void>(templates) {
@Override
public void parse() throws RecognitionException, TokenStreamException {

View File

@ -41,11 +41,11 @@ public class JPAQueryMutability2Test implements JPATest {
add(customOperator, "sign({0})");
}};
protected JPAQuery<Void> query() {
protected JPAQuery<?> query() {
return new JPAQuery<Void>(entityManager);
}
protected JPAQuery<Void> query(JPQLTemplates templates) {
protected JPAQuery<?> query(JPQLTemplates templates) {
return new JPAQuery<Void>(entityManager, templates);
}
@ -57,7 +57,7 @@ public class JPAQueryMutability2Test implements JPATest {
@Test
public void test() {
QCat cat = QCat.cat;
JPAQuery<Void> query = query().from(cat);
JPAQuery<?> query = query().from(cat);
query.fetchCount();
query.distinct().fetchCount();
@ -79,8 +79,8 @@ public class JPAQueryMutability2Test implements JPATest {
@Test
public void Clone() {
QCat cat = QCat.cat;
JPAQuery<Void> query = query().from(cat).where(cat.name.isNotNull());
JPAQuery<Void> query2 = query.clone(entityManager);
JPAQuery<?> query = query().from(cat).where(cat.name.isNotNull());
JPAQuery<?> query2 = query.clone(entityManager);
assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
query2.select(cat).fetch();
@ -89,7 +89,7 @@ public class JPAQueryMutability2Test implements JPATest {
@Test
public void Clone_Custom_Templates() {
QCat cat = QCat.cat;
JPAQuery<Void> query = query().from(cat);
JPAQuery<?> query = query().from(cat);
//attach using the custom templates
query.clone(entityManager, customTemplates)
.select(numberOperation(Integer.class, customOperator, cat.floatProperty)).fetchOne();
@ -98,7 +98,7 @@ public class JPAQueryMutability2Test implements JPATest {
@Test
public void Clone_Keep_Templates() {
QCat cat = QCat.cat;
JPAQuery<Void> query = query(customTemplates).from(cat);
JPAQuery<?> query = query(customTemplates).from(cat);
//keep the original templates
query.clone()
.select(numberOperation(Integer.class, customOperator, cat.floatProperty)).fetchOne();
@ -107,7 +107,7 @@ public class JPAQueryMutability2Test implements JPATest {
@Test(expected = IllegalArgumentException.class)
public void Clone_Lose_Templates() {
QCat cat = QCat.cat;
JPAQuery<Void> query = query(customTemplates).from(cat);
JPAQuery<?> query = query(customTemplates).from(cat);
//clone using the entitymanager's default templates
query.clone(entityManager)
.select(numberOperation(Integer.class, customOperator, cat.floatProperty)).fetchOne();

View File

@ -40,7 +40,7 @@ public class JPAQueryMutabilityTest implements JPATest {
private EntityManager entityManager;
protected JPASQLQuery<Void> query() {
protected JPASQLQuery<?> query() {
return new JPASQLQuery<Void>(entityManager, derbyTemplates);
}
@ -57,15 +57,15 @@ public class JPAQueryMutabilityTest implements JPATest {
entityManager.flush();
SAnimal cat = new SAnimal("cat");
JPASQLQuery<Void> query = query().from(cat);
JPASQLQuery<?> query = query().from(cat);
new QueryMutability(query).test(cat.id, cat.name);
}
@Test
public void Clone() {
SAnimal cat = new SAnimal("cat");
JPASQLQuery<Void> query = query().from(cat).where(cat.name.isNotNull());
JPASQLQuery<Void> query2 = query.clone(entityManager);
JPASQLQuery<?> query = query().from(cat).where(cat.name.isNotNull());
JPASQLQuery<?> query2 = query.clone(entityManager);
assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
query2.select(cat.id).fetch();

View File

@ -48,7 +48,7 @@ public class JPASQLBase extends AbstractSQLTest implements JPATest {
private EntityManager entityManager;
@Override
protected JPASQLQuery<Void> query() {
protected JPASQLQuery<?> query() {
return new JPASQLQuery<Void>(entityManager, templates);
}

View File

@ -35,8 +35,8 @@ public class JoinTest {
private final Entity alias = Alias.alias(Entity.class);
private final StringPath path = Expressions.stringPath("path");
private final JPAQuery<Void> subQuery = new JPAQuery<Void>();
private final HibernateQuery<Void> query = new HibernateQuery<Void>(new DummySessionHolder(), HQLTemplates.DEFAULT);
private final JPAQuery<?> subQuery = new JPAQuery<Void>();
private final HibernateQuery<?> query = new HibernateQuery<Void>(new DummySessionHolder(), HQLTemplates.DEFAULT);
@Test
public void SubQuery_InnerJoin() {

View File

@ -22,7 +22,7 @@ public class OrderHelperTest {
order.add("previousProject.customer.company.name");
order.add("department.name");
JPAQuery<Void> query = new JPAQuery<Void>();
JPAQuery<?> query = new JPAQuery<Void>();
query.from(entity);
OrderHelper.orderBy(query, entity, order);
assertEquals("select project\n" +

View File

@ -34,7 +34,7 @@ public class QueryMutabilityTest{
private Session session;
protected HibernateSQLQuery<Void> query() {
protected HibernateSQLQuery<?> query() {
return new HibernateSQLQuery<Void>(session, derbyTemplates);
}
@ -48,15 +48,15 @@ public class QueryMutabilityTest{
NoSuchMethodException, IllegalAccessException,
InvocationTargetException, IOException {
SAnimal cat = new SAnimal("cat");
HibernateSQLQuery<Void> query = query().from(cat);
HibernateSQLQuery<?> query = query().from(cat);
new QueryMutability(query).test(cat.id, cat.name);
}
@Test
public void Clone() {
SAnimal cat = new SAnimal("cat");
HibernateSQLQuery<Void> query = query().from(cat).where(cat.name.isNotNull());
HibernateSQLQuery<Void> query2 = query.clone(session);
HibernateSQLQuery<?> query = query().from(cat).where(cat.name.isNotNull());
HibernateSQLQuery<?> query2 = query.clone(session);
assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
//query2.fetch(cat.id);

View File

@ -41,7 +41,7 @@ public class QueryPerformanceTest implements JPATest {
Mode.target.remove();
}
private JPAQuery<Void> query() {
private JPAQuery<?> query() {
return new JPAQuery<Void>(entityManager);
}

View File

@ -46,7 +46,7 @@ public class RelationalFunctionCallTest {
QSurvey table = new QSurvey("SURVEY");
RelationalFunctionCall<String> func = SQLExpressions.relationalFunctionCall(String.class, "TableValuedFunction", "parameter");
PathBuilder<String> funcAlias = new PathBuilder<String>(String.class, "tokFunc");
SQLQuery<Void> sq = new SQLQuery<Void>();
SQLQuery<?> sq = new SQLQuery<Void>();
SubQueryExpression<?> expr = sq.from(table)
.join(func, funcAlias).on(table.name.like(funcAlias.getString("prop")).not()).select(table.name);

View File

@ -39,7 +39,7 @@ public class SerializationBase implements JPATest {
@Test
public void test() throws IOException, ClassNotFoundException{
// create query
JPAQuery<Void> query = query();
JPAQuery<?> query = query();
query.from(cat).where(cat.name.eq("Kate")).select(cat).fetch();
QueryMetadata metadata = query.getMetadata();
@ -54,7 +54,7 @@ public class SerializationBase implements JPATest {
assertEquals(metadata.getProjection(), metadata2.getProjection());
// create new query
JPAQuery<Void> query2 = new JPAQuery<Void>(entityManager, metadata2);
JPAQuery<?> query2 = new JPAQuery<Void>(entityManager, metadata2);
assertEquals("select cat\nfrom Cat cat\nwhere cat.name = ?1", query2.toString());
query2.select(cat).fetch();
}
@ -90,7 +90,7 @@ public class SerializationBase implements JPATest {
}
}
private JPAQuery<Void> query() {
private JPAQuery<?> query() {
return new JPAQuery<Void>(entityManager);
}

View File

@ -26,14 +26,14 @@ public class SubQueryTest extends AbstractQueryTest{
@Test
public void Single_Source() {
JPAQuery<Void> query = sub();
JPAQuery<?> query = sub();
query.from(cat);
assertEquals("select cat\nfrom Cat cat", query.toString());
}
@Test
public void Multiple_Sources() {
JPAQuery<Void> query = sub();
JPAQuery<?> query = sub();
query.from(cat);
query.from(fatcat);
assertEquals("select cat\nfrom Cat cat, Cat fatcat",

View File

@ -42,7 +42,7 @@ public class TupleTest extends AbstractQueryTest {
"(select cat.mate, max(cat.birthdate) from Cat cat group by cat.mate))", subQuery);
}
private HibernateQuery<Void> subQuery() {
private HibernateQuery<?> subQuery() {
return new HibernateQuery<Void>();
}

View File

@ -44,7 +44,7 @@ public class UniqueResultsTest implements HibernateTest {
assertEquals(Long.valueOf(3), query().from(cat).select(cat.count()).fetchOne());
}
private HibernateQuery<Void> query() {
private HibernateQuery<?> query() {
return new HibernateQuery<Void>(session);
}

View File

@ -92,7 +92,7 @@ public class CustomTypesTest extends AbstractJDBCTest{
assertEquals(1l, insert.execute());
// query
SQLQuery<Void> query = new SQLQuery<Void>(connection, configuration);
SQLQuery<?> query = new SQLQuery<Void>(connection, configuration);
assertEquals(Gender.MALE, query.from(person).where(person.id.eq(10)).select(person.gender).fetchOne());
// update

View File

@ -31,27 +31,27 @@ public class SpatialBase extends AbstractBaseTest {
// multilinestring 12-13
// multipolygon 14-15
private SQLQuery<Void> withPoints() {
private SQLQuery<?> withPoints() {
return query().from(shapes).where(shapes.id.between(1, 5));
}
private SQLQuery<Void> withLineStrings() {
private SQLQuery<?> withLineStrings() {
return query().from(shapes).where(shapes.id.between(6, 7));
}
private SQLQuery<Void> withPolygons() {
private SQLQuery<?> withPolygons() {
return query().from(shapes).where(shapes.id.between(8, 9));
}
private SQLQuery<Void> withMultipoints() {
private SQLQuery<?> withMultipoints() {
return query().from(shapes).where(shapes.id.between(10, 11));
}
private SQLQuery<Void> withMultiLineStrings() {
private SQLQuery<?> withMultiLineStrings() {
return query().from(shapes).where(shapes.id.between(12, 13));
}
private SQLQuery<Void> withMultiPolygons() {
private SQLQuery<?> withMultiPolygons() {
return query().from(shapes).where(shapes.id.between(14, 15));
}

View File

@ -31,7 +31,7 @@ import com.querydsl.core.types.SubQueryExpression;
* @author tiwe
*
*/
public abstract class AbstractSQLQueryFactory<Q extends SQLCommonQuery<Q>> implements SQLCommonQueryFactory<Q,
public abstract class AbstractSQLQueryFactory<Q extends SQLCommonQuery<?>> implements SQLCommonQueryFactory<Q,
SQLDeleteClause, SQLUpdateClause, SQLInsertClause, SQLMergeClause> {
protected final Configuration configuration;

View File

@ -25,7 +25,7 @@ import javax.sql.DataSource;
* @author tiwe
*
*/
public class SQLQueryFactory extends AbstractSQLQueryFactory<SQLQuery<Void>> {
public class SQLQueryFactory extends AbstractSQLQueryFactory<SQLQuery<?>> {
static class DataSourceProvider implements Provider<Connection> {
@ -59,7 +59,7 @@ public class SQLQueryFactory extends AbstractSQLQueryFactory<SQLQuery<Void>> {
}
@Override
public SQLQuery<Void> query() {
public SQLQuery<?> query() {
return new SQLQuery<Void>(connection.get(), configuration);
}

View File

@ -28,7 +28,7 @@ import com.querydsl.sql.SQLTemplates;
* @author tiwe
*
*/
public class SQLServerQueryFactory extends AbstractSQLQueryFactory<SQLServerQuery<Void>> {
public class SQLServerQueryFactory extends AbstractSQLQueryFactory<SQLServerQuery<?>> {
public SQLServerQueryFactory(Configuration configuration, Provider<Connection> connection) {
super(configuration, connection);
@ -42,7 +42,7 @@ public class SQLServerQueryFactory extends AbstractSQLQueryFactory<SQLServerQuer
this(new Configuration(templates), connection);
}
public SQLServerQuery<Void> query() {
public SQLServerQuery<?> query() {
return new SQLServerQuery<Void>(connection.get(), configuration);
}

View File

@ -29,7 +29,7 @@ import com.querydsl.sql.dml.SQLInsertClause;
* @author tiwe
*
*/
public class MySQLQueryFactory extends AbstractSQLQueryFactory<MySQLQuery<Void>> {
public class MySQLQueryFactory extends AbstractSQLQueryFactory<MySQLQuery<?>> {
public MySQLQueryFactory(Configuration configuration, Provider<Connection> connection) {
super(configuration, connection);
@ -61,7 +61,7 @@ public class MySQLQueryFactory extends AbstractSQLQueryFactory<MySQLQuery<Void>>
return insert;
}
public MySQLQuery<Void> query() {
public MySQLQuery<?> query() {
return new MySQLQuery<Void>(connection.get(), configuration);
}

View File

@ -28,7 +28,7 @@ import com.querydsl.sql.SQLTemplates;
* @author tiwe
*
*/
public class OracleQueryFactory extends AbstractSQLQueryFactory<OracleQuery<Void>> {
public class OracleQueryFactory extends AbstractSQLQueryFactory<OracleQuery<?>> {
public OracleQueryFactory(Configuration configuration, Provider<Connection> connection) {
super(configuration, connection);
@ -42,7 +42,7 @@ public class OracleQueryFactory extends AbstractSQLQueryFactory<OracleQuery<Void
this(new Configuration(templates), connection);
}
public OracleQuery<Void> query() {
public OracleQuery<?> query() {
return new OracleQuery<Void>(connection.get(), configuration);
}

View File

@ -25,7 +25,7 @@ import com.querydsl.sql.*;
* @author tiwe
*
*/
public class PostgreSQLQueryFactory extends AbstractSQLQueryFactory<PostgreSQLQuery<Void>> {
public class PostgreSQLQueryFactory extends AbstractSQLQueryFactory<PostgreSQLQuery<?>> {
public PostgreSQLQueryFactory(Configuration configuration, Provider<Connection> connection) {
super(configuration, connection);
@ -39,7 +39,7 @@ public class PostgreSQLQueryFactory extends AbstractSQLQueryFactory<PostgreSQLQu
this(new Configuration(templates), connection);
}
public PostgreSQLQuery<Void> query() {
public PostgreSQLQuery<?> query() {
return new PostgreSQLQuery<Void>(connection.get(), configuration);
}

View File

@ -28,7 +28,7 @@ import com.querydsl.sql.TeradataTemplates;
* @author tiwe
*
*/
public class TeradataQueryFactory extends AbstractSQLQueryFactory<TeradataQuery<Void>> {
public class TeradataQueryFactory extends AbstractSQLQueryFactory<TeradataQuery<?>> {
public TeradataQueryFactory(Configuration configuration, Provider<Connection> connection) {
super(configuration, connection);
@ -43,7 +43,7 @@ public class TeradataQueryFactory extends AbstractSQLQueryFactory<TeradataQuery<
}
@Override
public TeradataQuery<Void> query() {
public TeradataQuery<?> query() {
return new TeradataQuery<Void>(connection.get(), configuration);
}

View File

@ -136,8 +136,8 @@ public abstract class AbstractBaseTest {
return sqlMergeClause;
}
protected ExtendedSQLQuery<Void> extQuery() {
ExtendedSQLQuery<Void> extendedSQLQuery = new ExtendedSQLQuery<Void>(connection, configuration);
protected ExtendedSQLQuery<?> extQuery() {
ExtendedSQLQuery<?> extendedSQLQuery = new ExtendedSQLQuery<Void>(connection, configuration);
extendedSQLQuery.addListener(new TestLoggingListener());
return extendedSQLQuery;
}
@ -148,19 +148,19 @@ public abstract class AbstractBaseTest {
return mySQLReplaceClause;
}
protected SQLQuery<Void> query() {
protected SQLQuery<?> query() {
SQLQuery<Void> testQuery = new TestQuery<Void>(connection, configuration);
testQuery.addListener(new TestLoggingListener());
return testQuery;
}
protected TeradataQuery<Void> teradataQuery() {
TeradataQuery<Void> teradataQuery = new TeradataQuery<Void>(connection, configuration);
protected TeradataQuery<?> teradataQuery() {
TeradataQuery<?> teradataQuery = new TeradataQuery<Void>(connection, configuration);
teradataQuery.addListener(new TestLoggingListener());
return teradataQuery;
}
protected TestQuery<Void> testQuery() {
protected TestQuery<?> testQuery() {
TestQuery<Void> testQuery = new TestQuery<Void>(connection, configuration, new DefaultQueryMetadata());
testQuery.addListener(new TestLoggingListener());
return testQuery;

View File

@ -34,7 +34,7 @@ public abstract class AbstractSQLTemplatesTest {
private SQLTemplates templates;
protected SQLQuery<Void> query;
protected SQLQuery<?> query;
protected abstract SQLTemplates createTemplates();
@ -91,7 +91,7 @@ public abstract class AbstractSQLTemplatesTest {
assertEquals("from SURVEY survey1 inner join SURVEY survey2", query.toString());
}
protected SQLQuery<Void> sq() {
protected SQLQuery<?> sq() {
return new SQLQuery<Void>();
}

View File

@ -105,7 +105,7 @@ public class DeleteBase extends AbstractBaseTest{
QEmployee employee = new QEmployee("e");
Param<Integer> param = new Param<Integer>(Integer.class, "param");
SQLQuery<Void> sq = query().from(employee).where(employee.id.eq(param));
SQLQuery<?> sq = query().from(employee).where(employee.id.eq(param));
sq.set(param, -12478923);
SQLDeleteClause delete = delete(survey1);

View File

@ -83,7 +83,7 @@ public class ExtendedSQLTest {
QAuthor author = QAuthor.author;
QBook book = QBook.book;
MySQLQuery<Void> query = new MySQLQuery<Void>(null);
MySQLQuery<?> query = new MySQLQuery<Void>(null);
query.from(author)
.join(book).on(author.id.eq(book.authorId))
.where(book.language.eq("DE"), book.published.eq(new Date()))

View File

@ -325,7 +325,7 @@ public class InsertBase extends AbstractBaseTest {
@ExcludeIn(FIREBIRD) // too slow
public void Insert_With_SubQuery_Params() {
Param<Integer> param = new Param<Integer>(Integer.class, "param");
SQLQuery<Void> sq = query().from(survey2);
SQLQuery<?> sq = query().from(survey2);
sq.set(param, 20);
int count = (int)query().from(survey).fetchCount();

View File

@ -24,7 +24,7 @@ public class JoinUsageTest {
@Ignore
public void Join_Already_Declared() {
QSurvey survey = QSurvey.survey;
SQLQuery<Void> subQuery = new SQLQuery<Void>();
SQLQuery<?> subQuery = new SQLQuery<Void>();
subQuery.from(survey).fullJoin(survey);
}

View File

@ -48,7 +48,7 @@ public class QueryMutabilityTest{
public void test() throws IOException, SecurityException,
IllegalArgumentException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException {
SQLQuery<Void> query = new SQLQuery<Void>(connection, new DerbyTemplates());
SQLQuery<?> query = new SQLQuery<Void>(connection, new DerbyTemplates());
query.from(survey);
query.addListener(new TestLoggingListener());
new QueryMutability(query).test(survey.id, survey.name);
@ -56,8 +56,8 @@ public class QueryMutabilityTest{
@Test
public void Clone() {
SQLQuery<Void> query = new SQLQuery<Void>(new DerbyTemplates()).from(survey);
SQLQuery<Void> query2 = query.clone(connection);
SQLQuery<?> query = new SQLQuery<Void>(new DerbyTemplates()).from(survey);
SQLQuery<?> query2 = query.clone(connection);
assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
query2.select(survey.id).fetch();

View File

@ -123,7 +123,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf);
SQLQuery<?> query = new SQLQuery<Void>(conn, conf);
query.from(companies).where(companies.id.eq((long)i))
.select(companies.name).fetch();
}
@ -138,7 +138,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf);
SQLQuery<?> query = new SQLQuery<Void>(conn, conf);
CloseableIterator<String> it = query.from(companies)
.where(companies.id.eq((long)i)).select(companies.name).iterate();
try {
@ -160,7 +160,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf);
SQLQuery<?> query = new SQLQuery<Void>(conn, conf);
ResultSet rs = query.from(companies)
.where(companies.id.eq((long)i)).getResults(companies.name);
try {
@ -182,7 +182,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf, new DefaultQueryMetadata());
SQLQuery<?> query = new SQLQuery<Void>(conn, conf, new DefaultQueryMetadata());
query.from(companies).where(companies.id.eq((long)i))
.select(companies.name).fetch();
}
@ -197,7 +197,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf);
SQLQuery<?> query = new SQLQuery<Void>(conn, conf);
query.from(companies).where(companies.id.eq((long)i))
.select(companies.id, companies.name).fetch();
}
@ -212,7 +212,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf);
SQLQuery<?> query = new SQLQuery<Void>(conn, conf);
query.from(companies).where(companies.name.eq(String.valueOf(i)))
.select(companies.name).fetch();
}
@ -227,7 +227,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf);
SQLQuery<?> query = new SQLQuery<Void>(conn, conf);
CloseableIterator<String> it = query.from(companies)
.where(companies.name.eq(String.valueOf(i)))
.select(companies.name).iterate();
@ -250,7 +250,7 @@ public class QueryPerformanceTest {
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
QCompanies companies = QCompanies.companies;
SQLQuery<Void> query = new SQLQuery<Void>(conn, conf, new DefaultQueryMetadata());
SQLQuery<?> query = new SQLQuery<Void>(conn, conf, new DefaultQueryMetadata());
query.from(companies)
.where(companies.name.eq(String.valueOf(i)))
.select(companies.name).fetch();

View File

@ -50,7 +50,7 @@ public class RelationalFunctionCallTest {
public void Validation() {
QSurvey survey = QSurvey.survey;
TokenizeFunction func = new TokenizeFunction("func", "a", "b");
SQLQuery<Void> sub = new SQLQuery<Void>().from(func.as(func.alias)).where(survey.name.like(func.token));
SQLQuery<?> sub = new SQLQuery<Void>().from(func.as(func.alias)).where(survey.name.like(func.token));
System.out.println(sub);
}

View File

@ -12,14 +12,14 @@ import com.querydsl.core.types.dsl.Expressions;
public class RelationalPathExtractorTest {
private SQLQuery<Void> query() {
private SQLQuery<?> query() {
return new SQLQuery<Void>(SQLTemplates.DEFAULT);
}
@Test
public void SimpleQuery() {
QEmployee employee2 = new QEmployee("employee2");
SQLQuery<Void> query = query().from(employee, employee2);
SQLQuery<?> query = query().from(employee, employee2);
assertEquals(ImmutableSet.of(employee, employee2), extract(query.getMetadata()));
}
@ -27,7 +27,7 @@ public class RelationalPathExtractorTest {
@Test
public void Joins() {
QEmployee employee2 = new QEmployee("employee2");
SQLQuery<Void> query = query().from(employee)
SQLQuery<?> query = query().from(employee)
.innerJoin(employee2).on(employee.superiorId.eq(employee2.id));
assertEquals(ImmutableSet.of(employee, employee2), extract(query.getMetadata()));
@ -35,7 +35,7 @@ public class RelationalPathExtractorTest {
@Test
public void SubQuery() {
SQLQuery<Void> query = query().from(employee)
SQLQuery<?> query = query().from(employee)
.where(employee.id.eq(query().from(employee).select(employee.id.max())));
assertEquals(ImmutableSet.of(employee), extract(query.getMetadata()));
}
@ -43,7 +43,7 @@ public class RelationalPathExtractorTest {
@Test
public void SubQuery2() {
QEmployee employee2 = new QEmployee("employee2");
SQLQuery<Void> query = query().from(employee)
SQLQuery<?> query = query().from(employee)
.where(Expressions.list(employee.id, employee.lastname)
.in(query().from(employee2).select(employee2.id, employee2.lastname)));

View File

@ -14,7 +14,7 @@ public class SQLBindingsTest {
private QSurvey survey = QSurvey.survey;
private SQLQuery<Void> query = new SQLQuery<Void>(SQLTemplates.DEFAULT);
private SQLQuery<?> query = new SQLQuery<Void>(SQLTemplates.DEFAULT);
@Test
public void Empty() {

View File

@ -55,7 +55,7 @@ public class SQLSerializerTest {
@Test
public void CountDistinct() {
SQLSerializer serializer = new SQLSerializer(Configuration.DEFAULT);
SQLQuery<Void> query = new SQLQuery<Void>();
SQLQuery<?> query = new SQLQuery<Void>();
query.from(QEmployeeNoPK.employee);
query.distinct();
serializer.serializeForQuery(query.getMetadata(), true);
@ -69,7 +69,7 @@ public class SQLSerializerTest {
public void CountDistinct_PostgreSQL() {
Configuration postgresql = new Configuration(new PostgreSQLTemplates());
SQLSerializer serializer = new SQLSerializer(postgresql);
SQLQuery<Void> query = new SQLQuery<Void>();
SQLQuery<?> query = new SQLQuery<Void>();
query.from(QEmployeeNoPK.employee);
query.distinct();
serializer.serializeForQuery(query.getMetadata(), true);
@ -156,7 +156,7 @@ public class SQLSerializerTest {
@Test
public void From_Function() {
SQLQuery<Void> query = query();
SQLQuery<?> query = query();
query.from(Expressions.template(Survey.class, "functionCall()")).join(survey);
query.where(survey.name.isNotNull());
assertEquals("from functionCall()\njoin SURVEY SURVEY\nwhere SURVEY.NAME is not null", query.toString());
@ -164,7 +164,7 @@ public class SQLSerializerTest {
@Test
public void Join_To_Function_With_Alias() {
SQLQuery<Void> query = query();
SQLQuery<?> query = query();
query.from(survey).join(SQLExpressions.relationalFunctionCall(Survey.class, "functionCall"), Expressions.path(Survey.class, "fc"));
query.where(survey.name.isNotNull());
assertEquals("from SURVEY SURVEY\njoin functionCall() as fc\nwhere SURVEY.NAME is not null", query.toString());
@ -172,7 +172,7 @@ public class SQLSerializerTest {
@Test
public void Join_To_Function_In_Derby() {
SQLQuery<Void> query = new SQLQuery<Void>(new DerbyTemplates());
SQLQuery<?> query = new SQLQuery<Void>(new DerbyTemplates());
query.from(survey).join(SQLExpressions.relationalFunctionCall(Survey.class, "functionCall"), Expressions.path(Survey.class, "fc"));
query.where(survey.name.isNotNull());
assertEquals("from SURVEY SURVEY\njoin table(functionCall()) as fc\nwhere SURVEY.NAME is not null", query.toString());
@ -180,7 +180,7 @@ public class SQLSerializerTest {
@Test
public void Keyword_After_Dot() {
SQLQuery<Void> query = new SQLQuery<Void>(MySQLTemplates.DEFAULT);
SQLQuery<?> query = new SQLQuery<Void>(MySQLTemplates.DEFAULT);
PathBuilder<Survey> surveyBuilder = new PathBuilder<Survey>(Survey.class, "survey");
query.from(surveyBuilder).where(surveyBuilder.get("not").isNotNull());
assertFalse(query.toString().contains("`"));
@ -199,7 +199,7 @@ public class SQLSerializerTest {
Configuration conf = new Configuration(new DerbyTemplates());
conf.registerTableOverride("SURVEY", "surveys");
SQLQuery<Void> query = new SQLQuery<Void>(conf);
SQLQuery<?> query = new SQLQuery<Void>(conf);
query.from(survey);
assertEquals("from surveys SURVEY", query.toString());
}
@ -209,7 +209,7 @@ public class SQLSerializerTest {
Configuration conf = new Configuration(new DerbyTemplates());
conf.registerColumnOverride("SURVEY", "NAME", "LABEL");
SQLQuery<Void> query = new SQLQuery<Void>(conf);
SQLQuery<?> query = new SQLQuery<Void>(conf);
query.from(survey).where(survey.name.isNull());
assertEquals("from SURVEY SURVEY\n" +
"where SURVEY.LABEL is null", query.toString());
@ -220,7 +220,7 @@ public class SQLSerializerTest {
Configuration conf = new Configuration(new DerbyTemplates());
conf.registerColumnOverride("PUBLIC", "SURVEY", "NAME", "LABEL");
SQLQuery<Void> query = new SQLQuery<Void>(conf);
SQLQuery<?> query = new SQLQuery<Void>(conf);
query.from(survey).where(survey.name.isNull());
assertEquals("from SURVEY SURVEY\n" +
"where SURVEY.LABEL is null", query.toString());
@ -248,7 +248,7 @@ public class SQLSerializerTest {
System.err.println(serializer);
}
private SQLQuery<Void> query() {
private SQLQuery<?> query() {
return new SQLQuery<Void>();
}
@ -285,7 +285,7 @@ public class SQLSerializerTest {
QEmployee e = QEmployee.employee;
PathBuilder<Tuple> sub = new PathBuilder<Tuple>(Tuple.class, "sub");
SQLQuery<Void> query = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> query = new SQLQuery<Void>(SQLTemplates.DEFAULT);
query.withRecursive(sub,
query().unionAll(
query().from(e).where(e.firstname.eq("Mike"))
@ -321,7 +321,7 @@ public class SQLSerializerTest {
QEmployee e = QEmployee.employee;
PathBuilder<Tuple> sub = new PathBuilder<Tuple>(Tuple.class, "sub");
SQLQuery<Void> query = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> query = new SQLQuery<Void>(SQLTemplates.DEFAULT);
query.withRecursive(sub, sub.get(e.id), sub.get(e.firstname), sub.get(e.superiorId)).as(
query().unionAll(
query().from(e).where(e.firstname.eq("Mike"))

View File

@ -37,14 +37,14 @@ public class SQLSubQueryTest {
public String toString() { return name(); }
public Class<?> getType() { return Object.class; }
};
SQLQuery<Void> query = new SQLQuery<Void>();
SQLQuery<?> query = new SQLQuery<Void>();
query.from(employee)
.where(Expressions.booleanOperation(op, employee.id)).toString();
}
@Test
public void List() {
SQLQuery<Void> query = new SQLQuery<Void>();
SQLQuery<?> query = new SQLQuery<Void>();
query.from(employee);
SubQueryExpression<?> subQuery = query.select(employee.id, Expressions.constant("XXX"), employee.firstname);
List<? extends Expression<?>> exprs = ((FactoryExpression)subQuery.getMetadata().getProjection()).getArgs();
@ -56,7 +56,7 @@ public class SQLSubQueryTest {
@Test
public void List_Entity() {
QEmployee employee2 = new QEmployee("employee2");
SQLQuery<Void> query = new SQLQuery<Void>();
SQLQuery<?> query = new SQLQuery<Void>();
Expression<?> expr = query.from(employee)
.innerJoin(employee.superiorIdKey, employee2)
.select(employee, employee2.id);
@ -92,7 +92,7 @@ public class SQLSubQueryTest {
@Test
public void Unique() {
SQLQuery<Void> query = new SQLQuery<Void>();
SQLQuery<?> query = new SQLQuery<Void>();
query.from(employee);
SubQueryExpression<?> subQuery = query.select(employee.id, Expressions.constant("XXX"), employee.firstname);
List<? extends Expression<?>> exprs = ((FactoryExpression)subQuery.getMetadata().getProjection()).getArgs();
@ -137,7 +137,7 @@ public class SQLSubQueryTest {
.select(survey.name, Wildcard.count.as(operatorTotalPermits))
.as("top");
new SQLQuery(null, SQLTemplates.DEFAULT).from(e);
new SQLQuery<Void>(null, SQLTemplates.DEFAULT).from(e);
}
@Test

View File

@ -470,7 +470,7 @@ public class SelectBase extends AbstractBaseTest {
@Test
@ExcludeIn({SQLITE})
public void Date_Add() {
SQLQuery<Void> query = query().from(employee);
SQLQuery<?> query = query().from(employee);
Date date1 = query.select(employee.datefield).fetchFirst();
Date date2 = query.select(SQLExpressions.addYears(employee.datefield, 1)).fetchFirst();
Date date3 = query.select(SQLExpressions.addMonths(employee.datefield, 1)).fetchFirst();
@ -503,8 +503,8 @@ public class SelectBase extends AbstractBaseTest {
@ExcludeIn({DB2, SQLITE, TERADATA})
public void Date_Diff() {
QEmployee employee2 = new QEmployee("employee2");
SQLQuery<Void> query = query().from(employee).orderBy(employee.id.asc());
SQLQuery<Void> query2 = query().from(employee, employee2)
SQLQuery<?> query = query().from(employee).orderBy(employee.id.asc());
SQLQuery<?> query2 = query().from(employee, employee2)
.orderBy(employee.id.asc(), employee2.id.desc());
List<DatePart> dps = Lists.newArrayList();
@ -532,7 +532,7 @@ public class SelectBase extends AbstractBaseTest {
@Test
@ExcludeIn({DB2, HSQLDB, SQLITE, TERADATA})
public void Date_Diff2() {
SQLQuery<Void> query = query().from(employee).orderBy(employee.id.asc());
SQLQuery<?> query = query().from(employee).orderBy(employee.id.asc());
LocalDate localDate = new LocalDate(1970, 1, 10);
Date date = new Date(localDate.toDateMidnight().getMillis());
@ -651,7 +651,7 @@ public class SelectBase extends AbstractBaseTest {
@Test
public void DateTime() {
SQLQuery<Void> query = query().from(employee).orderBy(employee.id.asc());
SQLQuery<?> query = query().from(employee).orderBy(employee.id.asc());
assertEquals(Integer.valueOf(10), query.select(employee.datefield.dayOfMonth()).fetchFirst());
assertEquals(Integer.valueOf(2), query.select(employee.datefield.month()).fetchFirst());
assertEquals(Integer.valueOf(2000), query.select(employee.datefield.year()).fetchFirst());
@ -706,7 +706,7 @@ public class SelectBase extends AbstractBaseTest {
@Test
public void GroupBy_Superior() {
SQLQuery<Void> qry = query()
SQLQuery<?> qry = query()
.from(employee)
.innerJoin(employee._superiorIdKey, employee2);
@ -1849,14 +1849,14 @@ public class SelectBase extends AbstractBaseTest {
@Test
@ExcludeIn({DB2, DERBY, H2})
public void YearWeek() {
SQLQuery<Void> query = query().from(employee).orderBy(employee.id.asc());
SQLQuery<?> query = query().from(employee).orderBy(employee.id.asc());
assertEquals(Integer.valueOf(200006), query.select(employee.datefield.yearWeek()).fetchFirst());
}
@Test
@IncludeIn({H2})
public void YearWeek_H2() {
SQLQuery<Void> query = query().from(employee).orderBy(employee.id.asc());
SQLQuery<?> query = query().from(employee).orderBy(employee.id.asc());
assertEquals(Integer.valueOf(200007), query.select(employee.datefield.yearWeek()).fetchFirst());
}

View File

@ -11,7 +11,7 @@ import com.querydsl.core.testutil.IncludeIn;
public class SelectMySQLBase extends AbstractBaseTest {
protected MySQLQuery<Void> mysqlQuery() {
protected MySQLQuery<?> mysqlQuery() {
return new MySQLQuery<Void>(connection, configuration);
}

View File

@ -20,7 +20,7 @@ public class SelectOracleBase extends AbstractBaseTest {
private static final Logger logger = LoggerFactory.getLogger(AbstractSQLQuery.class);
protected OracleQuery<Void> oracleQuery() {
protected OracleQuery<?> oracleQuery() {
return new OracleQuery<Void>(connection, configuration) {
@Override
protected SQLSerializer serialize(boolean forCountRow) {

View File

@ -37,28 +37,28 @@ public class SerializationTest {
@Test
public void InnerJoin() {
SQLQuery<Void> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
SQLQuery<?> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
query.from(new QSurvey("s1")).innerJoin(new QSurvey("s2"));
assertEquals("from SURVEY s1\ninner join SURVEY s2", query.toString());
}
@Test
public void LeftJoin() {
SQLQuery<Void> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
SQLQuery<?> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
query.from(new QSurvey("s1")).leftJoin(new QSurvey("s2"));
assertEquals("from SURVEY s1\nleft join SURVEY s2", query.toString());
}
@Test
public void RightJoin() {
SQLQuery<Void> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
SQLQuery<?> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
query.from(new QSurvey("s1")).rightJoin(new QSurvey("s2"));
assertEquals("from SURVEY s1\nright join SURVEY s2", query.toString());
}
@Test
public void FullJoin() {
SQLQuery<Void> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
SQLQuery<?> query = new SQLQuery<Void>(connection,SQLTemplates.DEFAULT);
query.from(new QSurvey("s1")).fullJoin(new QSurvey("s2"));
assertEquals("from SURVEY s1\nfull join SURVEY s2", query.toString());
}
@ -112,7 +112,7 @@ public class SerializationTest {
public void FunctionCall() {
RelationalFunctionCall<String> func = SQLExpressions.relationalFunctionCall(String.class, "TableValuedFunction", "parameter");
PathBuilder<String> funcAlias = new PathBuilder<String>(String.class, "tokFunc");
SQLQuery<Void> sq = new SQLQuery<Void>();
SQLQuery<?> sq = new SQLQuery<Void>();
SubQueryExpression<?> expr = sq.from(survey)
.join(func, funcAlias).on(survey.name.like(funcAlias.getString("prop")).not())
.select(survey.name);
@ -130,7 +130,7 @@ public class SerializationTest {
public void FunctionCall2() {
RelationalFunctionCall<String> func = SQLExpressions.relationalFunctionCall(String.class, "TableValuedFunction", "parameter");
PathBuilder<String> funcAlias = new PathBuilder<String>(String.class, "tokFunc");
SQLQuery<Void> q = new SQLQuery<Void>(new SQLServerTemplates());
SQLQuery<?> q = new SQLQuery<Void>(new SQLServerTemplates());
q.from(survey)
.join(func, funcAlias).on(survey.name.like(funcAlias.getString("prop")).not());
@ -143,7 +143,7 @@ public class SerializationTest {
public void FunctionCall3() {
RelationalFunctionCall<String> func = SQLExpressions.relationalFunctionCall(String.class, "TableValuedFunction", "parameter");
PathBuilder<String> funcAlias = new PathBuilder<String>(String.class, "tokFunc");
SQLQuery<Void> q = new SQLQuery<Void>(new HSQLDBTemplates());
SQLQuery<?> q = new SQLQuery<Void>(new HSQLDBTemplates());
q.from(survey)
.join(func, funcAlias).on(survey.name.like(funcAlias.getString("prop")).not());
@ -154,7 +154,7 @@ public class SerializationTest {
@Test
public void Union() {
SQLQuery<Void> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
q.union(new SQLQuery<Void>().from(survey).select(survey.all()),
new SQLQuery<Void>().from(survey).select(survey.all()));
@ -168,7 +168,7 @@ public class SerializationTest {
@Test
public void Union_GroupBy() {
SQLQuery<Void> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
q.union(new SQLQuery<Void>().from(survey).select(survey.all()),
new SQLQuery<Void>().from(survey).select(survey.all()))
.groupBy(survey.id);
@ -184,7 +184,7 @@ public class SerializationTest {
@Test
public void Union2() {
SQLQuery<Void> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
q.union(survey,
new SQLQuery<Void>().from(survey).select(survey.all()),
new SQLQuery<Void>().from(survey).select(survey.all()));
@ -200,7 +200,7 @@ public class SerializationTest {
@Test
public void With() {
QSurvey survey2 = new QSurvey("survey2");
SQLQuery<Void> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
q.with(survey, survey.id, survey.name).as(
new SQLQuery<Void>().from(survey2).select(survey2.id, survey2.name));
@ -213,7 +213,7 @@ public class SerializationTest {
public void With_Tuple() {
PathBuilder<Survey> survey = new PathBuilder<Survey>(Survey.class, "SURVEY");
QSurvey survey2 = new QSurvey("survey2");
SQLQuery<Void> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
q.with(survey, survey.get(survey2.id), survey.get(survey2.name)).as(
new SQLQuery<Void>().from(survey2).select(survey2.id, survey2.name));
@ -225,7 +225,7 @@ public class SerializationTest {
@Test
public void With_Tuple2() {
QSurvey survey2 = new QSurvey("survey2");
SQLQuery<Void> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
q.with(survey, survey.id, survey.name).as(
new SQLQuery<Void>().from(survey2).select(survey2.id, survey2.name));
@ -237,7 +237,7 @@ public class SerializationTest {
@Test
public void With_SingleColumn() {
QSurvey survey2 = new QSurvey("survey2");
SQLQuery<Void> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
SQLQuery<?> q = new SQLQuery<Void>(SQLTemplates.DEFAULT);
q.with(survey, new Path[]{ survey.id }).as(
new SQLQuery<Void>().from(survey2).select(survey2.id));

View File

@ -99,7 +99,7 @@ public class SubqueriesBase extends AbstractBaseTest {
@ExcludeIn({MYSQL, POSTGRESQL, DERBY, SQLSERVER, TERADATA})
public void SubQuery_Params() {
Param<String> aParam = new Param<String>(String.class, "param");
SQLQuery<Void> subQuery = new SQLQuery<Void>().from(employee).where(employee.firstname.eq(aParam));
SQLQuery<?> subQuery = new SQLQuery<Void>().from(employee).where(employee.firstname.eq(aParam));
subQuery.set(aParam, "Mike");
assertEquals(1, query().from(subQuery.select(Wildcard.all)).fetchCount());
@ -130,7 +130,7 @@ public class SubqueriesBase extends AbstractBaseTest {
@Test
@SkipForQuoted
public void SubQuerySerialization() {
SQLQuery<Void> query = query();
SQLQuery<?> query = query();
query.from(survey);
assertEquals("from SURVEY s", query.toString());

View File

@ -71,7 +71,7 @@ public class UnionBase extends AbstractBaseTest {
public void Union_Multiple_Columns2() throws SQLException {
SubQueryExpression<Tuple> sq1 = query().from(employee).select(employee.firstname, employee.lastname);
SubQueryExpression<Tuple> sq2 = query().from(employee).select(employee.firstname, employee.lastname);
SQLQuery<Void> query = query();
SQLQuery<?> query = query();
query.union(sq1, sq2);
List<String> list = query.select(employee.firstname).fetch();
assertFalse(list.isEmpty());
@ -86,7 +86,7 @@ public class UnionBase extends AbstractBaseTest {
public void Union_Multiple_Columns3() throws SQLException {
SubQueryExpression<Tuple> sq1 = query().from(employee).select(employee.firstname, employee.lastname);
SubQueryExpression<Tuple> sq2 = query().from(employee).select(employee.firstname, employee.lastname);
SQLQuery<Void> query = query();
SQLQuery<?> query = query();
query.union(sq1, sq2);
List<Tuple> list = query.select(employee.lastname, employee.firstname).fetch();
assertFalse(list.isEmpty());
@ -247,7 +247,7 @@ public class UnionBase extends AbstractBaseTest {
SubQueryExpression<Employee> sq2 = query().from(employee)
.select(Projections.constructor(Employee.class, employee.id.as(idAlias)));
SQLQuery<Void> query = query();
SQLQuery<?> query = query();
query.union(sq1, sq2);
query.clone().select(idAlias).fetch();
}

View File

@ -85,7 +85,7 @@ public class UnionSubQueryTest {
"(select 3 from dual)", serializer.toString());
}
private SQLQuery<Void> query() {
private SQLQuery<?> query() {
return new SQLQuery<Void>();
}

View File

@ -163,7 +163,7 @@ public class UpdateBase extends AbstractBaseTest {
QEmployee employee = new QEmployee("e");
Param<Integer> param = new Param<Integer>(Integer.class, "param");
SQLQuery<Void> sq = query().from(employee).where(employee.id.eq(param));
SQLQuery<?> sq = query().from(employee).where(employee.id.eq(param));
sq.set(param, -12478923);
SQLUpdateClause update = update(survey1);

View File

@ -26,14 +26,14 @@ public class SQLServerQueryTest {
@Test
public void TableHints_Single() {
SQLServerQuery<Void> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
SQLServerQuery<?> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
query.from(survey).tableHints(SQLServerTableHints.NOWAIT).where(survey.name.isNull());
assertEquals("from SURVEY SURVEY with (NOWAIT)\nwhere SURVEY.NAME is null", query.toString());
}
@Test
public void TableHints_Multiple() {
SQLServerQuery<Void> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
SQLServerQuery<?> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
query.from(survey).tableHints(SQLServerTableHints.NOWAIT, SQLServerTableHints.NOLOCK).where(survey.name.isNull());
assertEquals("from SURVEY SURVEY with (NOWAIT, NOLOCK)\nwhere SURVEY.NAME is null", query.toString());
}
@ -41,7 +41,7 @@ public class SQLServerQueryTest {
@Test
public void TableHints_Multiple2() {
QSurvey survey2 = new QSurvey("survey2");
SQLServerQuery<Void> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
SQLServerQuery<?> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
query.from(survey).tableHints(SQLServerTableHints.NOWAIT)
.from(survey2).tableHints(SQLServerTableHints.NOLOCK)
.where(survey.name.isNull());

View File

@ -10,7 +10,7 @@ import com.querydsl.sql.domain.QSurvey;
public class PostgreSQLQueryTest {
private PostgreSQLQuery<Void> query;
private PostgreSQLQuery<?> query;
private QSurvey survey = new QSurvey("survey");