Hi,


> My preferred way writing this in an action would be:
>
> MyDBObject obj = new MyDBObject();
> data.getParameters().setProperties (obj);
> obj.save();
>
> Then the save method looks something like
>
>              if (getID() == NEW_ID)
> >             {
> >                 // Sometimes add some specific code here
> >                 MyDBObjectPeer.doInsert (obj);
> >             }
> >             else
> >             {
> >                 // Sometimes add some specific code here
> >                 MyDBObjectPeer.doUpdate (obj);
> >             }
>

This is probably a better idea - keep unnecessary code out of the action.  We'll
just need to add a save() method to the DataObject that gets generated.  Thanx !

~ Leon



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to