I'm writing an application where the primary key for a table is a natural
key and comes in as part of a data payload after making a call to a remote
system. I can be certain that this value is unique.  So I've modeled it in
the database and have it in the data model. Of course this means that in
the java object this field is absent.

I'm going to want to do selects on it, and comparisons to other fields. So
I really need it to be part of the model.  So is it best to just add it
into the java object.  So that it's part of the mapping or is there another
technique that is a better choice.

Just as an aside, let's not devolve into a discussion of should the key be
visible. I understand the pluses and minuses of that decision and for this
case, its really the right thing to do.



Tony Giaccone

Reply via email to