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 Equals operator (hibernate4) #43

Closed ilopmar closed 10 years ago

ilopmar commented 10 years ago

First operator to check if an attribute in a json field is equals to some value.

@Alotor do you like this kind of operators? (notEquals,...)

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.57%) when pulling 156f03ac8245899f48629612236d2278e1a7a2c1 on json_equals_hibernate4 into 6b9218a969c0add2e5587f0da9c6a4bff1e6df43 on master.

Alotor commented 10 years ago

Everything looks good but I don't like the name "equal" for this operation.

Maybe "contains"? If you read equals you are expecting to pass a JSON.

ilopmar commented 10 years ago

But with "contains" you should pass a json and with "equals" you check some field in the json against some value.

Alotor commented 10 years ago

I don't like neither "contains" nor "equals"

Maybe "hasFieldValue" ?

ilopmar commented 10 years ago

Watch out that in pg 9.4 there are new operators such as contains, is contained,... Just like arrays.

I like hasFieldValue. I'll change it and do push -f

Alotor commented 10 years ago

The operations in 9.4 are for JSONB not for "plain old json" :shit:

ilopmar commented 10 years ago

Cancelled. Continues in #46