public static class MetaJsonRecordRepository.MetaJsonRecordQuery extends Query<MetaJsonRecord>
Query.Selector
Constructor and Description |
---|
MetaJsonRecordQuery(String jsonModel) |
Modifier and Type | Method and Description |
---|---|
Query<MetaJsonRecord> |
by(String field,
Object value) |
Query<MetaJsonRecord> |
by(String field,
String operator,
Object value) |
Query<MetaJsonRecord> |
filter(String filter,
Object... params)
A convenient method to filter the query using JPQL's where clause.
|
autoFlush, bind, bind, bind, cacheable, count, countQuery, delete, deleteQuery, em, fetch, fetch, fetch, fetchOne, fetchOne, fetchSteam, fetchSteam, fetchSteam, fetchStream, fetchStream, fetchStream, filter, of, order, readOnly, remove, select, selectQuery, selectQuery, toString, update, update, update, update, updateQuery, updateQuery
public MetaJsonRecordQuery(String jsonModel)
public Query<MetaJsonRecord> filter(String filter, Object... params)
Query
The filter string should refer the field names with self.
prefix and values should
not be embedded into the filter string but should be passed by parameters and ?
placeholder should be used to mark parameter substitutions.
Here is an example:
Query<Person> query = Query.of(Person); query = query.filter("self.name = ? AND self.age >= ?", "some", 20); List<Person> matched = query.fetch();
This is equivalent to:
SELECT self from Person self WHERE (self.name = ?1) AND (self.age >= ?2)
The params passed will be added as positional parameters to the JPA query object before
performing Query.fetch()
.
filter
in class Query<MetaJsonRecord>
filter
- the filter stringparams
- the parameterspublic Query<MetaJsonRecord> by(String field, String operator, Object value)
public Query<MetaJsonRecord> by(String field, Object value)