kaleidos / grails-postgresql-extensions

Grails plugin to use postgresql native elements such as arrays, hstores,...
Apache License 2.0
78 stars 62 forks source link

Json support hibernate4 #40

Closed ilopmar closed 10 years ago

ilopmar commented 10 years ago

First version of the json support for Hibernate 4

ilopmar commented 10 years ago

@alotor. Please do not merge it yet.

I'm thinking about supporting both Map and JsonObject using ParameterizedType as you did with ArrayType. What do you think about it?

Alotor commented 10 years ago

To your question I don't think you should parametrize... maybe two different user types it's better.

One question. Which operations are you planning to support?

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-0.23%) when pulling a9cbfd67ff940d68fb0dc5d7cbd5e8ca4593e802 on json_support_hibernate4 into 8a5243cd6bb46c3483da3f15fce15dcfbf65ef1b on master.

ilopmar commented 10 years ago

I don't know which operators we should support. I have to read about json in Pg and do some tests. Do you have any suggestions?

I'll create a new UserType for JsonObject, update the documentation and do a push -f to this branch.

Alotor commented 10 years ago

http://www.postgresql.org/docs/9.3/static/functions-json.html

Maybe we can use these functions to implement "has field" and "contains" (only to check if a field has a specific value)

ilopmar commented 10 years ago

Ok, I'll try it :-)

ilopmar commented 10 years ago

@Alotor ready to merge if you want it. Then I'll release 4.1.0 and backport the changes to 3.x branch.

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-0.13%) when pulling ed7470f3960dcaafc925bf93438de75dc8a51bbc on json_support_hibernate4 into 8a5243cd6bb46c3483da3f15fce15dcfbf65ef1b on master.

Alotor commented 10 years ago

Great! looks awesome :)