Bug 200947 - No JoinTables selectable in JPA Details
Summary: No JoinTables selectable in JPA Details
Status: RESOLVED DUPLICATE of bug 192172
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dali.general-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-23 10:21 EDT by Mark Hoffmann CLA
Modified: 2007-11-12 16:39 EST (History)
2 users (show)

See Also:


Attachments
Sample entity, with ddl and sample content (1.66 KB, application/x-zip-compressed)
2007-08-23 10:40 EDT, Mark Hoffmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hoffmann CLA 2007-08-23 10:21:29 EDT
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.
Comment 1 Mark Hoffmann CLA 2007-08-23 10:40:52 EDT
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.
Comment 2 Karen Butzke CLA 2007-08-23 12:46:29 EDT
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>
Comment 3 Neil Hauge CLA 2007-11-12 16:39:34 EST
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 ***