I use a code generator which generates a nested class, roughly as follows:
package generated;
@Entity(name = "Items")
@Table(name = "ITEMS")
@Inheritance(strategy = InheritanceType.JOINED)
public class Items
implements Equals, HashCode
{
protected List<Items.Item> item;
@OneToMany(targetEntity = Items.Item.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "ITEM_ITEMS_HJID")
public List<Items.Item> getItem() {
if (item == null) {
item = new ArrayList<Items.Item>();
}
return this.item;
}
public void setItem(List<Items.Item> item) {
this.item = item;
}
// ...
@Entity(name = "Items$Item")
@Table(name = "ITEM")
@Inheritance(strategy = InheritanceType.JOINED)
public static class Item
implements Equals, HashCode
{
// ...
}
}
I'm getting the following error in Eclipse:
The Java class for mapped type "
Items$Item
" is a member class
The error is marked on the @Entity(name = "Items$Item")
line.
What does this error mean and what can I do about it?
My roundtrip tests (save entity to the database, load, compare to the original) work just fine.