- java.lang.Object
-
- io.ebean.typequery.TQProperty<R>
-
- io.ebean.typequery.TQPropertyBase<R>
-
- io.ebean.typequery.PJson<R>
-
- Type Parameters:
R- the root query bean type
public final class PJson<R> extends TQPropertyBase<R>
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RjsonEqualTo(String path, Object value)Value at the given JSON path is equal to the given value.RjsonExists(String path)Path exists - for the given path in a JSON document.RjsonGreaterOrEqual(String path, Object value)Greater than or equal to - for the given path in a JSON document.RjsonGreaterThan(String path, Object value)Greater than - for the given path in a JSON document.RjsonLessOrEqualTo(String path, Object value)Less than or equal to - for the given path in a JSON document.RjsonLessThan(String path, Object value)Less than - for the given path in a JSON document.RjsonNotEqualTo(String path, Object value)Not Equal to - for the given path in a JSON document.RjsonNotExists(String path)Path does not exist - for the given path in a JSON document.-
Methods inherited from class io.ebean.typequery.TQPropertyBase
asc, desc
-
Methods inherited from class io.ebean.typequery.TQProperty
expr, isNotNull, isNull, propertyName, toString
-
-
-
-
Method Detail
-
jsonExists
public R jsonExists(String path)
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
public R jsonNotExists(String path)
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
public R jsonEqualTo(String path, Object value)
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
public R jsonNotEqualTo(String path, Object value)
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
public R jsonGreaterThan(String path, Object value)
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
public R jsonGreaterOrEqual(String path, Object value)
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
public R jsonLessThan(String path, Object value)
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
-
-