Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

schema not set using @ManyToMany/@JoinTable

Michael GrimmJun 27 2007 — edited Aug 21 2007
Hello!

I have a many-to-many parent-child-relation using the same table:

@ManyToMany()
@JoinTable(name="VI_A_SP_SERVICE",schema="ESGT",
joinColumns=@JoinColumn(name="A_SERVICE_VATER_SERVICE_NR",referencedColumnName="A_SERVICE_VATER_SERVICE_NR"),
inverseJoinColumns=@JoinColumn(name="A_SERVICE_NR",referencedColumnName="A_SERVICE_NR"))
private List<Service> parents;

@ManyToMany(mappedBy="parents",fetch=FetchType.EAGER)
private List<Service> children;

The schema attribute in the JoinTable annotation is ignored resulting in an ORA-00942: table or view does not exist:

javax.faces.FacesException: Cant instantiate class: at.linzag.imds.serviceportal.web.beans.CatalogueBean.. class at.linzag.imds.serviceportal.web.beans.CatalogueBean : Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.DatabaseException Internal Exception: java.sql.SQLException: ORA-00942: table or view does not exist Error Code: 942 Call: SELECT t1.A_SVCSTRK_NR, t1.A_SERVICE_ANMERK_TEXT, t1.A_SERVICE_BO_KZ, t1.A_SERVICE_NR, t1.PE_UNTEINH_SCHL, t1.A_SERVICE_KLASSE_SCHL, t1.A_SERVICE_EINH_SCHL, t1.A_SERVICE_HINWEIS_TEXT, t1.A_SERVICE_PREIS_AKT_WT, t1.A_SERVICE_VERR_HFGKEIT_KZ, t1.A_SERVICE_NAME, t1.A_SERVICE_VATER_SERVICE_NR, t1.A_SERVICE_BESCHR_TEXT FROM VI_A_SP_SERVICE t0, ESGT.VI_A_SP_SERVICE t1 WHERE ((t0.A_SERVICE_NR = ?) AND (t1.A_SERVICE_VATER_SERVICE_NR = t0.A_SERVICE_VATER_SERVICE_NR)) bind => [6] Query: ReadAllQuery(at.linzag.imds.serviceportal.model.Service)

orm.xml includes a default schema that is added correctly to one part of the joined query, the other part remains empty.

Any ideas?

Thanks
Mike

Message was edited by:
mgrimm
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2007
Added on Jun 27 2007
6 comments
1,271 views