Community
Participate
Working Groups
Build ID: I20070621-1340 Steps To Reproduce: 1. Create a ManyToMany mapping 2. Try to select a table in the join table selection in JPA Details view 3. To get the annotation you can type-in you table name. YOu get the error that this table doesn't exist in your default schema. 4. Even using the notation database.table makes the error disappear The Mapping works well in my testing-application. More information: It is not possible to select a join-table in general. Because of that it is not possible to set the joinColumns and inverseJoinColumns. It is always possible to overwrite the default-values but the validation in the editor doesn't work correctly. example: @ManyToMany(targetEntity=model.Contact.class) @JoinTable(name = "contact_contact", joinColumns=@JoinColumn(name="source_id"), inverseJoinColumns = @JoinColumn(name="target_id") Collection<Contact> otherContacts = new ArrayList<Contact>(1); The error is: Schema "default-schema" cannot be resolved for join table "contact_contact". I don't know where this default-schema name comes from. It is further not possible to select another schema in this JPA Detail. The entity itself is mapped to another schema.
Created attachment 76774 [details] Sample entity, with ddl and sample content This is a small sample that shows the right mapping on the one hand and hopefully the jpa error in the editor.
bug 192172 is open for adding schema/catalog combo widgets to the TableGenerator and JoinTable JPA details views. You will need to set the schema for the JoinTable annotation in the source. The default for this schema is not taken from the schema set on the Entity Table. Is this a schema you want to use in all your entities? If so, you can set the default schema in your orm.xml file: <persistence-unit-metadata> <persistence-unit-defaults> <schema>backoffice</schema> </persistence-unit-defaults> </persistence-unit-metadata>
I am marking this as a duplicate, as I think the bug discussed here is logged as mentioned. Please let me know if there is an undocumented problem associated with this issue and if so re-open the bug. *** This bug has been marked as a duplicate of bug 192172 ***