my2iu / Jinq

LINQ-style queries for Java 8
Other
659 stars 71 forks source link

Support for compareTo for AttributeConverter types #80

Open mkp05 opened 4 years ago

mkp05 commented 4 years ago

It would be great to be able to have support also for compareTo method (translated to SQL probably to </> operators - they work for most types in DB engines) for datatypes using AttributeConverter and registered by registerAttributeConverterType. As I see in the docs (and from stacktrace :D) currently only equals is supported.

I think it can be assumed that simple comparison operators can be used and it would be great for using rich domain objects (written around single DB column) directly in entities and then in JINQ queries.

my2iu commented 4 years ago

Jinq relies on Hibernate/JPA for its queries, and it's a little unclear whether JPA actually handles comparison operators with AttributeConverters in an intelligent way or not (it might just compare the raw data in the SQL database, which can cause all sorts of unexpected behavior). So I'm hesitant about such a feature.