Bug 201 : Scheme is ignored on join table mapping
Priority 
High
Reported Version 
 
Logged By 
ptrepagnier
Status 
Fixed
Fixed Version 
2.4.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
08/01/2010
Updated 
08/01/2010
Type 
Bug
 
Attachments 
No attachments

Here is the annotation for a many to many association:

@ManyToMany(fetch=FetchType.LAZY)
@JoinTable(name="USER_ROLE_MAPPING", schema="$QUALITY", catalog="METTEST", joinColumns = {
@JoinColumn(name="USERID", nullable=false, updatable=false) }, inverseJoinColumns = {
@JoinColumn(name="ROLEID", nullable=false, updatable=false) })
public List getRoles() {
return this.roles;
}

This results in the following SQL that is missing the schema for the join table:

select u.ID c0
, ur.ID c1, ur.ROLE c2, ur.DESCRIPTION c3
from METTEST.$QUALITY.USER u
left outer join USER_ROLE_MAPPING urz_ on urz_.USERID = u.ID
left outer join METTEST.$QUALITY.ROLE ur on ur.ID = urz_.ROLEID
where u.ID = ?
order by u.ID

 
Rob 11 Jan 10:50
Fixed in HEAD

Fixed in HEAD.

Note that this excludes DDL generation across schema's which is not supported at this time.

As a workaround the table name can be fully qualified as catalog.schema.tablename

woResponse

Upload a file