Menu

#6 allow sequenced pk within compound pk

open
nobody
None
5
2001-08-23
2001-08-23
Anonymous
No

Currently, an exception is thrown if a sequenced
column is part of a compound primary key. This is
because the CompoundPrimaryKeyColumnSpec defaults to
setRequired(true) which requires all fields to have a
value on an insert. Since the sequence is not
assigned until after that step, the validateRequired()
fails.

To get around this, the following files were modified:

CompoundPrimaryKeyColumnSpec:
addColumnSpec() was modified to NOT set the column
spec as required.

getSequencedColumn() was added to allow the retrieval
of a sequenced column within the column spec. It is
assumed that at most ONE sequenced column will exist.

InsertSQLBuilder:
buildSQL() was modified to include a conditional
statement to handle CompoundPrimaryKeyColumnSpecs.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.