|
When I load objects from the DB, I want to hook them up to transient 'managers.' How do I do this?
In an example, my persistent classes are Auction and Bids; each Auction has a set of Bids. There are also transient classes AuctionManager and BidManager, which hold collections of the respective types of objects. A BidManager is used, for example, to notify the security department when a bid is higher than twice any other bid in the auction site.,
In a multi-frame Swing app, each frame shows an independent AuctionSite and so holds its own AuctionManager and a BidManager.
I need to set a manager field in each Auction and in each Bid, as it is loaded. In loading Auctions in a given AuctionSite by query, I set the relevant AuctionManager on each one.
But the Bids get loaded lazily, by reachabilility from their 'parent' Auction. I have no hook into the loading process by which I can set the Bid's BidManager (onLoad does not offer any way to find the 'right' BidManager for the purpose).
Any ideas?
Joshua
|