Hi,
just wanted to evaluate querydsl dynamic queries in combination with postgres.
Problem is, creating the correct SQLQueryFactory or "How do i execute the query".
Here is my code:
01. SQLTemplates templates = new PostgresTemplates();
02. Configuration config = new Configuration(templates);
03. PathBuilder<Object> myEntityPath = new PathBuilder<Object>(Object.class,"myentity");
04. NumberPath<Integer> idPath = myEntityPath.getNumber("id",Integer.class);
05. //Constant<String> idVal = Expressions.constant((T) 2);
06. //BooleanExpression be = Expressions.predicate(Ops.GT, idPath, idVal);
07. SQLQueryFactory f = new SQLServerQueryFactory(() -> c); // WHERE IS THE POSTGRES-Factory?
08. FilteredClause fi = f
09. .from(myEntityPath)
10. .where(idPath.gt(3))
11. ;
12.
13. // HOW TO EXECUTE THE QUERY?
14.
How can I execute a dynamic SQL query against a postgres database?
The documentation says I have to create an instance of "SQLQueryFactory" via the "new" keyword, but SQLQueryFactory is an interface.
Please, can anybody help me?
Thanks in advance,
Alex