java.lang.Object
io.ebean.typequery.TQProperty<R,String>
io.ebean.typequery.TQPropertyBase<R,String>
io.ebean.typequery.PJson<R>
- Type Parameters:
R- the root query bean type
- All Implemented Interfaces:
io.ebean.Query.Property<String>
JSON document type.
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"
-
Field Summary
Fields inherited from class io.ebean.typequery.TQProperty
_name, _root -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjsonEqualTo(String path, Object value) Value at the given JSON path is equal to the given value.jsonExists(String path) Path exists - for the given path in a JSON document.jsonGreaterOrEqual(String path, Object value) Greater than or equal to - for the given path in a JSON document.jsonGreaterThan(String path, Object value) Greater than - for the given path in a JSON document.jsonLessOrEqualTo(String path, Object value) Less than or equal to - for the given path in a JSON document.jsonLessThan(String path, Object value) Less than - for the given path in a JSON document.jsonNotEqualTo(String path, Object value) Not Equal to - for the given path in a JSON document.jsonNotExists(String path) Path does not exist - for the given path in a JSON document.Methods inherited from class io.ebean.typequery.TQPropertyBase
asc, descMethods inherited from class io.ebean.typequery.TQProperty
expr, isNotNull, isNull, propertyName, toString
-
Constructor Details
-
PJson
Construct with a property name and root instance.- Parameters:
name- property nameroot- the root query bean instance
-
PJson
Construct with additional path prefix.
-
-
Method Details
-
jsonExists
Path exists - for the given path in a JSON document.new QSimpleDoc() .content.jsonExists("meta.title") .findList();- Parameters:
path- the nested path in the JSON document in dot notation
-
jsonNotExists
Path does not exist - for the given path in a JSON document.new QSimpleDoc() .content.jsonNotExists("meta.title") .findList();- Parameters:
path- the nested path in the JSON document in dot notation
-
jsonEqualTo
Value at the given JSON path is equal to the given value.new QSimpleDoc() .content.jsonEqualTo("title", "Rob JSON in the DB") .findList();new QSimpleDoc() .content.jsonEqualTo("path.other", 34) .findList();- Parameters:
path- the dot notation path in the JSON documentvalue- the equal to bind value
-
jsonNotEqualTo
Not Equal to - for the given path in a JSON document.- Parameters:
path- the nested path in the JSON document in dot notationvalue- the value used to test equality against the document path's value
-
jsonGreaterThan
Greater than - for the given path in a JSON document.- Parameters:
path- the nested path in the JSON document in dot notationvalue- the value used to test against the document path's value
-
jsonGreaterOrEqual
Greater than or equal to - for the given path in a JSON document.- Parameters:
path- the nested path in the JSON document in dot notationvalue- the value used to test against the document path's value
-
jsonLessThan
Less than - for the given path in a JSON document.- Parameters:
path- the nested path in the JSON document in dot notationvalue- the value used to test against the document path's value
-
jsonLessOrEqualTo
Less than or equal to - for the given path in a JSON document.- Parameters:
path- the nested path in the JSON document in dot notationvalue- the value used to test against the document path's value
-