Ok that is in master now.
This adds support for Map<String,Object> ... stored as JSON content to Clob, Blob, Varchar, JSON, JSONB.
This adds support for JsonNode ... stored as JSON content to Clob, Blob, Varchar, JSON, JSONB.
Right now there is benefit in using Map<String,Object> over JsonNode in that it supports dirty checking (so you can mutate the content and Ebean knows if it has been mutated and includes the content in an update etc - with JsonNode there is no dirty checking so if the property is loaded then it is included in an update regardless).
You annotate the property with @DbJson or @DbJsonB. Note that @DbJsonB is a 'shortcut' for @DbJson(storage = DbJsonType.JSONB).
Note that JSON on Postgres uses its JSON type and on all other DB's will use Clob.
Note that JSONB on Postgres uses its JSONB type and on all other DB's will use Clob (I think this is the most sensible fallback for non-Postgres)
You can explicitly specify to use VARCHAR, BLOB or CLOB via the storage property on @DbJson along with a length when using VARCHAR.
At the moment there isn't support for the extra Oracle DDL syntax (so if you start using this with Oracle's JSON support you may want to tweak Ebean's generated DDL as desired).
You can use Ebean's JSON support to marshall/unmarshall the entire bean from/to JSON. Obviously we want to do this wrt the upcoming ElasticSearch integration.
Currently these properties will default to be eagerly fetched and it would be good to perhaps control that default behavior like we can with Clobs/Blobs. At the moment use the select() clause on the where to control when there load as per normal properties.
There are various tests for the combinations (Map/JsonNode properties to various db types) in com.avaje.tests.json package.
So yes, feel free to give it a whirl. I intend to get another release this weekend (if you don't want to build from master yourself).
Also note that with the JSONB operators that Postgres supports some of these using '?' which is not great with JDBC. The best workaround that I know at this time is to create a database function (in order to utilise indexes etc).
Cheers, Rob.