Potentially spurious validation message about attribute mapping? [message #897023] |
Fri, 20 July 2012 15:22  |
Eclipse User |
|
|
|
Dali has just today started to throw an error on some JPA annotations that have been working for quite some time. I really don't know why these errors popped up today, but in any event here is what is going on.
It is essentially the exact same error and situation reported here in 2009:
http://www.eclipse.org/forums/index.php/t/156133/
I have a bidirectional OneToMany...here is the annotations on the parent object and the child object:
Class Parent {
...
@Override
@OneToMany(targetEntity = ClassVersion.class, mappedBy = "parent", cascade = { PERSIST, REMOVE })
@OrderBy("versionNum")
public List<Child> getVersions() {
return super.getVersions();
}
}
Class Child {
...
@Override
@ManyToOne(targetEntity = Parent.class, optional = false)
@JoinColumn(name = "parent_id", referencedColumnName = "uuid", updatable = false, nullable = false)
public Parent getParent() {
return (Parent) super.getParent();
}
}
The error message is in the parent class and says that the attribute mapped by "parent" has an invalid mapping type for this relationship.
The code compiles and runs just fine. It produces a table for the parent and a table for the child with the column "parent_id" and appropriate constraints.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.59655 seconds