class Foo {
Long id;
String name;
String content;
}
class FooQo {
@QueryCondition
Long id;
@QueryCondition
String name;
String content; // 不加注解,不作为查询条件
}
FooQo fooQo = new FooQo(1L, "foo", "content");
Specification<Foo> specification = SpecificationFactory.getSpecification(fooQo);
List<Foo> foos = fooRepository.findAll(specification);
SELECT DISTINCT *
FROM FOO
WHERE FOO.ID = 1
AND LOWER(FOO.NAME) = 'foo';
class Foo {
Long id;
String name;
String content;
}
@QueryObject
class FooQo {
Long id;
String name;
String content;
}
FooQo fooQo = new FooQo(1L, "foo", "content");
Specification<Foo> specification = SpecificationFactory.getSpecification(fooQo);
List<Foo> foos = fooRepository.findAll(specification);
SELECT * FROM FOO
WHERE FOO.ID = 1
AND LOWER(FOO.NAME) = 'foo'
AND LOWER(FOO.CONTENT) = 'content';