Ajusting code to use JPA... Not yet functional