I want to write a totally dynamic query method, which gets dinamically column names as parameters. Column names i.e : id, age, name, etc. I'm going to use criteria query, however I don't know how it's done exactly.
Some example says:
"Path<Long> idPath = personRoot.get( Person_.id );
Path<Integer> agePath = personRoot.get( Person_.age );
criteria.select( builder.array( idPath, agePath ) );"
My problem is the usage of "builder.array" part. How can I put together my (i.e:) path elements into a "Selection... selections" parameter in order to the "select" accept it and be valid my dynamic query?
Is there any possibility to write multiple group by according to my "Selection... selections" parameter in the "select" part?
Any hints appreciated, thank You in advance.