on 11-16-2009 6:52 PM
Hello,
somehow I'm not able to set up a bidirectional OneToMany relationship. I'm just getting the generic "could not inject EntityManager" exception. This is basically what i have:
class A implements AInterface {
@OneToMany(targetEntity = B.class, mappedBy = ...)
private Set<B> bs;
}
class B implements BInterface {
@ManyToOne(targetEntity = A.class, optional = false)
@JoinColumn(name = "A_ID", nullable = false)
private A a;
}
Could someone give me some advice, please?
Konrad
solved...
The targetEntity annotation on ManyToOne does not work ... this is also true for OneToOne ... if you use the concrete entities it works
Edited by: konrad.krentz on Nov 17, 2009 9:39 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Konrad,
Is there any particular reason that you think the problem is in the relationship definition?
Could be also in the persistence unit definition...
Can you give some more details on the application environment - persistence.xml, DataSource & alias definitions, EM injection, etc?
Best,
Yordan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.