Elaborated hibernate entitymanager example