R - the root query bean typepublic class PJson<R> extends TQProperty<R>
Type that is JSON content mapped to database types such as Postgres JSON/JSONB and otherwise Varchar,Clob and Blob.
The expressions on this type are valid of Postgres and Oracle.
The path can reference a nested property in the JSON document using dot notation - for example "documentMeta.score" where "score" is an embedded attribute of "documentMeta"
| Constructor and Description |
|---|
PJson(String name,
R root)
Construct with a property name and root instance.
|
PJson(String name,
R root,
String prefix)
Construct with additional path prefix.
|
| Modifier and Type | Method and Description |
|---|---|
R |
jsonEqualTo(String path,
Object value)
Value at the given JSON path is equal to the given value.
|
R |
jsonExists(String path)
Path exists - for the given path in a JSON document.
|
R |
jsonGreaterOrEqual(String path,
Object value)
Greater than or equal to - for the given path in a JSON document.
|
R |
jsonGreaterThan(String path,
Object value)
Greater than - for the given path in a JSON document.
|
R |
jsonLessOrEqualTo(String path,
Object value)
Less than or equal to - for the given path in a JSON document.
|
R |
jsonLessThan(String path,
Object value)
Less than - for the given path in a JSON document.
|
R |
jsonNotEqualTo(String path,
Object value)
Not Equal to - for the given path in a JSON document.
|
R |
jsonNotExists(String path)
Path does not exist - for the given path in a JSON document.
|
public PJson(String name, R root)
name - property nameroot - the root query bean instancepublic R jsonExists(String path)
new QSimpleDoc()
.content.jsonExists("meta.title")
.findList();
path - the nested path in the JSON document in dot notationpublic R jsonNotExists(String path)
new QSimpleDoc()
.content.jsonNotExists("meta.title")
.findList();
path - the nested path in the JSON document in dot notationpublic R jsonEqualTo(String path, Object value)
new QSimpleDoc()
.content.jsonEqualTo("title", "Rob JSON in the DB")
.findList();
new QSimpleDoc()
.content.jsonEqualTo("path.other", 34)
.findList();
path - the dot notation path in the JSON documentvalue - the equal to bind valuepublic R jsonNotEqualTo(String path, Object value)
path - the nested path in the JSON document in dot notationvalue - the value used to test equality against the document path's valuepublic R jsonGreaterThan(String path, Object value)
path - the nested path in the JSON document in dot notationvalue - the value used to test against the document path's valuepublic R jsonGreaterOrEqual(String path, Object value)
path - the nested path in the JSON document in dot notationvalue - the value used to test against the document path's valuepublic R jsonLessThan(String path, Object value)
path - the nested path in the JSON document in dot notationvalue - the value used to test against the document path's valuepublic R jsonLessOrEqualTo(String path, Object value)
path - the nested path in the JSON document in dot notationvalue - the value used to test against the document path's valueCopyright © 2016. All rights reserved.