google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

Add Validator for correct usage of @Index(Direction.GEO2D) #253

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
it should check that this Direction is used on double[] or (better) a dedicated 
type morphia provides (LatLng ?) only.

Original issue reported on code.google.com by google-a...@codesmell.de on 21 Mar 2011 at 4:33

GoogleCodeExporter commented 9 years ago
We should not limit it to a special type, but we can validate that it is a 2 
item (single dimension) array or object with two fields (persisted).

Original comment by scotthernandez on 22 Mar 2011 at 2:30

GoogleCodeExporter commented 9 years ago
I agree...

Providing a LatLng Type as a bean that has two doubles will help though, just 
like the LongIdEntity you did.

interested how you´d want to validate that a persistent-display of a user 
provided class is going to boil down to two doubles only in all cases.

(for instance @PreSave might add a third)

Original comment by google-a...@codesmell.de on 22 Mar 2011 at 3:15

GoogleCodeExporter commented 9 years ago
Sure, a util class might help some; and as a more readable example.

In the case for a query we can check it, but no it can't be perfect just based 
on the metadata for @Index checking.

Original comment by scotthernandez on 22 Mar 2011 at 3:22