datapublica / hibernate-pg-json

Provide json/jsonb mapping for hibernate
MIT License
17 stars 3 forks source link

JsonB support #3

Open snowe2010 opened 7 years ago

snowe2010 commented 7 years ago

Does this library support jsonb? I'm getting this error:

ERROR: column "data" is of type json but expression is of type jsonb
  Hint: You will need to rewrite or cast the expression.
  Position: 110

The code looks like

@Column(name = "data")
@Type(type = "Json", parameters = @Parameter(name = "type", value = DecisionLoanView.CLASS_NAME))
private DecisionLoanView decisionLoanView;
WydD commented 7 years ago

By default it is in jsonb. Apparently your datatype in your column is "json" and the lib tries to send a jsonb. If you want to have a simple json you can use @Parameter(name = "binary", value = "false")