add hibernate distinct code