Convert from direct hibernate to hibernate via JPA