Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [dtp-dev] Primary key is not visualized correct

Hey Dimiter,

> The generic catalog loader works pretty fine for MAXDB. The issue with
> missing PK decorator is triggered, because JDBCTableConstraintLoader
returns
> null for PrimaryKey in method loadPrimaryKey(PrimaryKey existingPK) when
PK
> column is more that on (ResultSet.getString(COLUMN_PK_NAME) returns
null).
> This could be avoided if we set column name as pkName. In this case
> PrimaryKey presentation will be created and columns, which are part of
it,
> will be added to it.
> Because this could solve similar issues with other databases, I think
that
> make sense to fix it in JDBCTableConstraintLoader. I would create request
in
> Bugzilla and even to present patch with fix. What is your opinion?
>

I think this is a legitimate problem.  The documentation for get*Keys()
clearly states that the FK and PK name columns may be null and I think
those cases should be handled (where PK/FK name == null).

However, I'm not quite sure of the best way to address the issue.  Whatever
method is chosen must be such that the referenced keys can be resolved
appropriately (e.g. finding the referenced PK/UC for a FK).  We also need
to be careful not to duplicate the name of another key.  I'll need to check
the SQL specification to see how this should best be handled (if at all).

A simple work around is to produce a result set that has PK/FK name defined
appropriately (using whatever default you choose; e.g. column name).

Please create a BZ for this (feel free to attach your proposed solution as
well).

Thanks for finding this.

Best regards,
Rob Cernich
DTP Connectivity Project Lead



Back to the top