[jOOQ/jOOQ#11292] AbstractMeta.getForeignKeys() and other key / index producing methods don't handle namespacing correctly
This commit is contained in:
parent
0cca2dc384
commit
35a70eb4bc
@ -73,7 +73,7 @@ abstract class AbstractKey<R extends Record> extends AbstractNamed implements Ke
|
||||
}
|
||||
|
||||
AbstractKey(Table<R> table, Name name, TableField<R, ?>[] fields, boolean enforced) {
|
||||
super(name, null);
|
||||
super(qualify(table, name), null);
|
||||
|
||||
this.table = table;
|
||||
this.fields = fields;
|
||||
|
||||
@ -123,7 +123,10 @@ abstract class AbstractNamed extends AbstractQueryPart implements Named {
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
static final Name qualify(Named qualifier, Name name) {
|
||||
return qualifier == null || name.qualified() ? name : qualifier.getQualifiedName().append(name);
|
||||
// [#9820] [#11292] name == null || name.empty() are special cases that
|
||||
// may appear when using unnamed constraint declarations.
|
||||
// Their unnamedness must not be changed, nor qualified!
|
||||
return qualifier == null || name == null || name.empty() || name.qualified() ? name : qualifier.getQualifiedName().append(name);
|
||||
}
|
||||
|
||||
static final <N extends Named> List<N> findAll(String name, Iterable<? extends N> in) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user