move JPA stuff from Rest to Core