我有一个项目,其中dao正在使用规范。我需要按年份获得大于某个实体的列表。我为此编写了规范,但是方法无法正常工作:
% pyinstaller --add-data my_file.db:. --add-data another_file.json:. /directory/to/your/code/script.py
年是表中的public static Specification<Entity> YearEqualTo(String year, boolean isBefore) {
return new Specification<Entity>() {
@Override
public boolean isSatisfied(Entity obj) {
return false;
}
@Override
public Predicate toPredicate(Root<Entity> root, CriteriaBuilder builder) {
if (isBefore)
return builder.lessThan(root.get("year"), year);
return builder.greaterThanOrEqualTo(root.get("year"), year);
}
};
}
。如何正确执行?