Best reason to use ids rather than some magic code is there is a
posibility that the code may change somewhere down the track.
e.g. if you linked order lines to an order by the order number what
happens if the customer required a change to the exisiting order numbers
(say adding a prefix or suffix). Youd have to change the order records
and the order line records (after removing contraints and then
reinstating them after the change). Using ids (something not related to
the business models) you are free to change the business rules without
affecting the integrity of you data.
My rule of thumb is to always use integer (32/64 bit) ids to join
related tables, and this id should only be used for the join (not
containing some magic business model value). It’s a RDBMS construct not
a business construct.
If you were using an OODB then you wouldn’t have the id, the
relationship would be defined through aggreagation.