I had the same requirement to use HEXPIRE to set ttl for fields. As spring data redis, doesn't have any methods as of now, I have implemented the below code to run the command :
redisTemplate.execute((RedisCallback<Object>)connection ->connection.execute("HEXPIRE", ...args)
This worked a bit, this was storing cache in hash with ttl per field, but this was raising exception post setting the TTL like : ByteArrayOutput doens't not support set(long) , so to make it work temporarily I caught the exception and ignored it.
I know it's not good like this... :(
let me know if you found any solution..