on 04-17-2008 11:40 AM
Hello
This is the current situation:
I have 3 JPA entity classes much like these (including constructors, getters, setters, ...).
@Entity
public abstract class OuComponent {
@ManyToOne
private Ou ou;
}
@Entity
public class Ou extends OuComponent {
@OneToMany
private Collection<OuComponent> ouComponentCollection;
}
@Entity
public class Person extends Component {}
In the database, OuComponent has a discriminator column.
This structure appears to work in a normal web module and an EJB Module.
In Web Dynpro, using a model, I can create a new Person and attach an existing Ou to it (through the inherited property ou from OuComponent).
However, when I try to display the information, I recieve the following error:
java.lang.IllegalArgumentException: Cannot perform write operation 'setRelatedModelObjects' on target role: Class 'Person' is not compatible to class 'OuComponent' of target role 'ouComponentCollection' in model class 'Ou'
It appears that Web Dynpro does not realise that Person is actually a subclass from OuComponent. I think it simply checks the discriminatorcolumn for the word 'OuComponent' and throws this exception because it finds a related entity of the type Person instead of OuComponent (even though, as stated, Person IS-A OuComponent. Web Dynpro just seems to ignore it).
How could I bypass this?
Thanks for your feedback
Hi Vincent.
Have you resolve this problem? If yes, could you post the solution?
Regards
Marcos Brandã
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.