christian wrote:
This has nothing to do with the EJB3/JPA implementation. Post this in the regular user forum and follow the HowToAskForHelp guidelines.
I found the cause, so I'll just post that here for reference:
The entity that was showing this weird behaviour was giving me infamous "cannot simultaneously fetch multiple bags" error. So to work around that I annotated one of my List<> One-To-Many relations with @IndexColumn(name = "id").
This turned out to be not such a good solution; if the releation contains for example child objects with ids 12 and 17 then Hibernate will create an array with 17 items, adding the child objects at index 'id' and setting the rest to null.
Duh :)
I now removed @IndexColumn and disable outer join fetching until Hibernate has fixed the 'multiple bags' bug.
S.