adapted to JPA