Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json type doesn't supports generic type #2

Closed
quaff opened this issue Jun 22, 2016 · 1 comment
Closed

Json type doesn't supports generic type #2

quaff opened this issue Jun 22, 2016 · 1 comment

Comments

@quaff
Copy link

quaff commented Jun 22, 2016

https://vladmihalcea.com/2016/06/20/how-to-map-json-objects-using-generic-hibernate-types/
@Type(type = "json") @Column(columnDefinition = "json") private Location location;
works fine.
@Type(type = "json") @Column(columnDefinition = "json") private List<Location> locations; will failed.
( (ParameterType) parameters.get( PARAMETER_TYPE ) ).getReturnedClass() should return ParameterizedType instead of Class.
Maybe AttributeConverter is a better solution.

@vladmihalcea
Copy link
Owner

It's intended to be like that because PostgreSQL and MySQL allow you to save a single root JSON object. Mapping a list of JSON objects is not, therefore, supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants