I would do something similar as well (though just make sure to purge it back out if something goes wrong in the rest of the transaction, since you'll probably be returning the object back to the view for use in displaying the data they entered into the form and you don't want it to have the wrong ID). Which means, of course, make sure this whole process is wrapped in a cftransaction block so that it succeeds or fails as a single unit. The service layer is often a good place for transaction logic since it usually applies to multiple domain objects at once.
On 10/10/07, Rich <[EMAIL PROTECTED]> wrote: > > > Now I could do > > this in my super classes create() method, by having it return the ID for > > the > > entry it just created, however this does feel a little unusual, mainly > > because I'm not used to working with super objects, is that the correct > > way > > At the end of SUPER.create( ARGUMENTS.SubObject ) you can have the parent > DAO call ARGUMENTS.SubObject.setID( newlyCreatedId ) which will make it > available in the child. Make sure you make this a transaction so you > don't > end up having orphaned IDs in the parent table. > > HTH, > Rich Kroll > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290771 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

