|
Hi Jeff, I started out thinking exactly the same
and so did not see a problem with the entire update. However, there are some
fields in the table that are not getting displayed. Now here, I need to fire a
select, find out what the current value is, and then put that value in the parameter
object. Which basically means an additional select per update. I will write a custom update for the last
login date. Thanks a lot for your help. Regards ~Rashmi From: Jeff Butler
[mailto:[EMAIL PROTECTED] Hi Dave, I understand the "last login date" requirement - I would
write a custom update for that requirement. For the other, I've always taken a different stance on these kinds of
things. It seems easier to me to update the whole record that do do the
dirty checking you would need to do to accomplish the selective update.
The problem is this - how do you know what fields have changed? If this
is a web app, then you would need to read the old record and do a field by
field check (or use some kind of _javascript_ hack to set dirty flags). If
it's not a web app, then its certainly easier to manage the state - but
you would still have to do the dirty check or set dirty flags somehow.
I've always thought it was easier just to update the entire record. Just my thoughts - your experience may be different. Jeff Butler
On 2/15/06, Rashmi Dave
<[EMAIL PROTECTED]>
wrote: Hi Jeff, I have a form – Update Profile of the User. Here, I would
like to update only those columns that have changed. Also, when my user logs in, I want to update only the
Last_Login_date field of the user table. This is why I need it. Hope this clarifies. Regards ~Rashmi From: Jeff Butler [mailto: [EMAIL PROTECTED]] Hi Dave, 1. You
don't need to regenerate the maps if all you're changing is NOT NULL
to NULL. Abator doesn't care about the nullability of a
column. But regenerating the maps shouldn't be a big issue anyway -
Abator was designed so you could run it repeatedly without losing anything
extra you've added. 2. You
are correct that the update statement updates all columns. You'll need to
write custom update statements if you want to update a subset of the
columns. I think
it is unusual to do selective column updates if you are working with
anything close to a rich domain model - I've never had that requirement on any
of my projects. That's why I didn't add support for it in Abator. I
suppose it wouldn't be that difficult to add if there is a general feeling that
it's needed. Does anyone else have any thoughts about this? Jeff
Butler On
2/15/06, Rashmi Dave <
[EMAIL PROTECTED]> wrote: Hi All, |
- Selective Update of fields depending on values in object Rashmi Dave
- Re: Selective Update of fields depending on values in... Jeff Butler
- RE: Selective Update of fields depending on value... Rashmi Dave
- Re: Selective Update of fields depending on v... Jeff Butler
- RE: Selective Update of fields depending ... Rashmi Dave
- Re: Selective Update of fields depen... Ed Griebel
- RE: Selective Update of fields depending on values in... Wible, Thomas E
- RE: Selective Update of fields depending on value... Rashmi Dave
- Re: Selective Update of fields depending on v... Jeff Butler
