Java Persistence API extention for working with hierarchial structures