Added cast function for value selection (or usage)

- supported as far as hibernate supports it