Christopher Whu wrote:How do you guys handle this. Would it be bad form for me to just overload my Customer class constructor to create an ID-less object?
It kind of depends on what you need to do with these 'ID-less' Customers. Are you likely to actually do anything with them other than creating rows in the database? Or do they become part of some 'pending' set until credentials have been verified? If that's the case, and you need to persist them, you may want to have some sort of status (active/inactive/pending); alternatively, if you want to hold them in Java until you're ready to make them active, you could create a subclass or a wrapper (PendingCustomer?) that uses something like a UUID as its key.
I have to admit to a slight preference for the status code, although it's arguably not entirely normalized; however,
you should then run the INSERT as fast as you possibly can, so that you don't have too many Customer objects "in limbo".
Winston