Overlay for building hibernate queries