Usage of JPA persistence framework