reducing the class code to instantiate connection JPA