Hi, Theoretically, you can create an index and use >= and <= comparisons for any data type. In your particular case, I think, using BigInteger is the most straightforward approach.
Hope this helps. On Fri, Jun 28, 2019 at 9:39 AM Prasad Bhalerao < [email protected]> wrote: > Hi, > > I want to store 128 bit number as a one the field in value object in my > cache. > > I can do that using multiple ways. > e.g. > 1) I can store 128 bit number using java.math.BigInteger. > a) But If store it using BigInteger, can I create index on this > field? > b) How can I use this field in where clause to filter the data? > > 2) I can store 128 bit number using byte array (byte[]). > a) Can I create an index on byte array? > b) Can I use this byte array field in where clause to filter the data. > e.g. mostly the where clause would be bytearr >=? and bytearr > <= > > 3) I can implement my own Number datatype e.g. Int128 using two long > numbers and and I implement compareTo method which is a bit tricky. > a) I can create index on nested objects but how I can use this Int128 > data type field in where clause and make use of overridden compareTo method > to filter the data? > > Can someone please advise? > > > > Thanks, > Prasad > > >
