it is an interresting problem, i knew this is one way to get the ID i also lnow of the LifeCycle interface but wanted to see if there was yet another way of doing this, perhaps right in the mapping document.
the reason we are doing this it to provide 'code' which for now will be the primary key for the attribute. at some point later in the lifecycle of this app the code may be something different that the primary key. so for now, we want to use the PK to identify the data as this is going to be unique and is 'right there' on the insert. i hope this makes sense.
we still have a PK attribute but also have a code attribute, which for now will be the PK. yes i know there is some data redundancy but this is by design.
|