Crashes when trying to use a unique index on an expression rather than on a single column.
This works:
create unique index vehicle_unique on vehicle (registration);
This doesn't work:
create unique index vehicle_unique on vehicle (lcase(registration));
Probably, the solution is not to generated the "select by UI" methods for the second case. It doesn't make sense. Does it?
The java exception says:
Key column 'K00' not found on table 'VEHICLE'.
SquirrelSQL shows "K00" as a pseudo column for the expression lcase(registration) in the JDBC metadata reported for the unique index.
Fix: the simple solution was to ignore unique indexes on expressions. They can never be the target of a FK.
Unique indexes on columns are kept since they are suitable as the target of an FK.