I've read your fine book pretty much from cover to cover, and am just getting ready to get my hands dirty, but first I have one important question which wasn't answered by the text.
In my preliminary design, I have two classes/tables which will contain nothing but balances, being aged balances for the Client class and the Debt class. These will be among the most volatile tables in the system - most of the others contain static, rarely updated info or are mostly insert-only.
For this reason, in SQL terms, I had in mind to perform all the updates to these tables using SQL expressions, something like this...
UPDATE DB_BALANCE SET PAID = (PAID+ 23.45), COMMISSION = (COMMISSION + 2.35), ...
Obviously, this beans bypassing the normal persistence mechanisms, and until today I had in mind to do this by making my balance classes immutable and updating them in hand-written DAO classes. But today, I came across the ClassPersister interface, and I'm wondering whether perhaps I shouldn't write my own custom ClassPersisters instead.
So that's the question. Should I write custom ClassPersisters, or is there some better way of doing this that I've missed so far?
Oh, and if I do write my own ClassPersisters, what is the best persister to extend?
Running Hibernate version 2.1.
TIA for any and all suggestions,
Luke
|