sample_clause
The sample_clause lets you instruct the database to select from a random sample of data from the table, rather than from the entire table.
I want to run below query using QueryDSL
sample_clause
The sample_clause lets you instruct the database to select from a random sample of data from the table, rather than from the entire table.
select from Test t SAMPLE(80) WHERE t.test_id=01 and t.test_suite_id=02;
where the condition is dynamic and I am generating it using queryDSL however I don't know how to add the SAMPLE keyword to query DSL.
public Long getCount(TestDTO testDTO) {
JPAQuery<Tuple> query = new JPAQuery<>(entityManager);
QTest qTest=QTest.test;
//dynamic where condition.
OptionalBooleanBuilder where = buildCondition(testDTO);
List<BigDecimal> output=query
.select(qTest.testId)
.from(qTest)
.where(where.build()).fetch();
//finally return the output.
}