We are trying to define a json column at hibernate as follows:
The entity class:
@TypeDef( name="CustomType", CustomJSONType.class)
...
@Type( name = "CustomType")
@Column
private JSONObject myColumn;
...
The CustomJSONType
class implements UserType
.
When application runs, the logs show me the following error trace:
2018-02-06 08:46:44.067 ERROR [company-operations-module,,,] 11804 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000389: Unsuccessful: create table operation (id int4 not null, creation timestamp not null, type varchar(50) not null, request_data json not null, response_data json, status varchar(50) not null, user_id varchar(30), primary key (id))
2018-02-06 08:46:44.067 ERROR [operations-module,,,] 11804 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : Unknown data type: "JSON" Unknown data type: "JSON"; SQL statement: create table operation (id int4 not null, creation timestamp not null, type varchar(50) not null, request_data json...) [50004-190]
2018-02-06 08:46:44.067 INFO [operations-module,,,] 11804 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete
Any idea? Thanks in advance.