Skip to content

IDs and Searching

randomcoder edited this page Oct 30, 2011 · 1 revision

Some last minute thoughts.

The id classes are over engineered for their task, i.e. to identify things in the database. The extra stuff was there to fulfil presentation requirements.

The real solution is to have all ids as longs with a unique name for the identifier field (e.g. invoiceId for invoices and addressId for addresses) this way a query can be done for all instances of one type by using the id field name, and simple substitution can be fine to display a type specific id on a document and the reverse process can be fine when searching from the web UI.

Clone this wiki locally