The issue is not about Artist.getItems().
The issue is about when I do Artist.getBOOKS() then movies are also returned, which I guess is an error.
Book extend Item and Movie extend Item.
Artist has one to many relation with both Book and Movie.
In this scenario, when I do artist.getBooks() then, I think, the expected behavior is to return only books and not movies.
If you think it is not an error then I can switch the default value of superclassDiscriminatorStrategyByDefault to be false.
This will return both books and movies when I do artist.getBooks().
If a user do not want to get both books and movies when artist.getBooks() is called, then they can do one of the below :
1. use openJPA specific annotation ElementClassCriteria to get only books.
2. use superclassDiscriminatorStrategyByDefault = true to get only books.