Comments (4)
Hi @darrachequesne , I have read the documentation for the SearchBuilder
, but I'm still not completely sure how it should be applied on the server-side. Could you give some hints?
from spring-data-jpa-datatables.
I have an idea of creating multiple enum
s which are mapped to specific CriteriaBuilder
methods. Do you think it will be a good design decision?
from spring-data-jpa-datatables.
For example:
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class Criteria {
private Condition condition;
private String data;
private String origData;
private String type;
private List<String> value;
private String logic;
private List<Criteria> criteria;
public <T> Predicate notEmpty(Root<T> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
return criteriaBuilder.equal(criteriaBuilder.length(root.get(origData)), 0);
}
}
And condition enum
will look like that:
public enum Condition {
NOT_EMPTY("!null", (builder) -> builder::notEmpty);
private String key;
private Function<Criteria, Specification> predicate;
Condition(String key, Function<Criteria, Specification> predicate) {
this.key = key;
this.predicate = predicate;
}
}
from spring-data-jpa-datatables.
I would be willing to throw in $100 to get this working
from spring-data-jpa-datatables.
Related Issues (20)
- Can we search date in data table? HOT 2
- Duplicates items after filtering HOT 2
- Log Exceptions or they are silently lost HOT 4
- Add support for Spring Boot 3.0.0 HOT 3
- Is it possible to use specification for view? HOT 2
- Is it possible to do a regular expression search using ~ in PostgreSQL? HOT 2
- AddOrder doesnt seem to work HOT 2
- Filtering data sometimes throws ORM exception (Hibernate 6.1) HOT 10
- No property 'findAll' found for type 'Class' HOT 4
- Performance issue (suggestions on database indexes) HOT 7
- [question] specifications and counting total records HOT 4
- Show ManyToMany data HOT 1
- enable datatable repositories without using DatatablesJpaRepositoryBean HOT 1
- Order can be null HOT 4
- Specify date format in global/column search when database column is date (Oracle) HOT 4
- Searching for a record with special (national) character "ř" doesn't work HOT 5
- Search Panes Error in Relationship Table HOT 3
- Library Source does not match the bytecode HOT 2
- Extend JpaRepository instead of PagingAndSortingRepository HOT 1
- Request to Change datatableInputs and outputs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-jpa-datatables.