Can you $Class->update_all() ?

[prev] [thread] [next] [Date index for 2004/07/19]

From: Ian McDonald-ONLINE
Subject: Can you $Class->update_all() ?
Date: 17:53 on 19 Jul 2004
This is a multi-part message in MIME format.

------_=_NextPart_001_01C46DB9.48B91826
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thanks for the helpful answers about select_on_update. I'm beginning to
realise that most of the power of Class DBI for more sophisticated
applications happens when you customise classes and use some private
methods (like sth_to_objects).

For my application, I'd like to be able to issue a single command which
will run update on every Class::DBI object which needs it, and does not
generate SQL for those which do not. This will probably be impemented as
a method of a UnitOfWork class which knows which table classes exist and
will go through them all calling a $Class->update_all() method.

My questions are:
* Is something like this possible with Class::DBI?
* How?
* Will it only run SQL commands for the Class::DBI objects which really
have changed?

Thanks,

Ian

--
Dr Ian McDonald
Software Engineer, Interactive Drama & Entertainment
A300, 56-58 Wood Lane (CH), London W12 7SB
020 822 56162
ian.mcdonald@xxx.xx.xx / "Ian McDonald-ONLINE" (not "Ian MacDonald")



http://www.bbc.co.uk/ - World Wide Wonderland

This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system.=20
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received.=20
Further communication will signify your consent to this.

------_=_NextPart_001_01C46DB9.48B91826
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-asci=
i">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 6.0.6503.0=
">
<TITLE>Can you $Class-&gt;update_all() ?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks for the helpful answers about sel=
ect_on_update. I'm beginning to realise that most of the power of Class D=
BI for more sophisticated applications happens when you customise classes=
 and use some private methods (like sth_to_objects).</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">For my application, I'd like to be able =
to issue a single command which will run update on every Class::DBI objec=
t which needs it, and does not generate SQL for those which do not. This =
will probably be impemented as a method of a UnitOfWork class which knows=
 which table classes exist and will go through them all calling a $Class-=
&gt;update_all() method.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">My questions are:</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">* Is something like this possible with =
Class::DBI?</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">* How?</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">* Will it only run SQL commands for the=
 Class::DBI objects which really have changed?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Ian</FONT>
</P>

<P><FONT COLOR=3D"#808080" SIZE=3D1 FACE=3D"Arial">--</FONT>

<BR><FONT COLOR=3D"#808080" SIZE=3D1 FACE=3D"Arial">Dr Ian McDonald</FONT=
>

<BR><FONT COLOR=3D"#808080" SIZE=3D1 FACE=3D"Arial">Software Engineer, In=
teractive Drama &amp; Entertainment</FONT>

<BR><FONT COLOR=3D"#808080" SIZE=3D1 FACE=3D"Arial">A300, 56-58 Wood Lane=
 (CH), London W12 7SB</FONT>

<BR><FONT COLOR=3D"#808080" SIZE=3D1 FACE=3D"Arial">020 822 56162</FONT>

<BR><FONT COLOR=3D"#808080" SIZE=3D1 FACE=3D"Arial">ian.mcdonald@xxx.xx.x=
k / &quot;Ian McDonald-ONLINE&quot; (not &quot;Ian MacDonald&quot;)</FONT=
>
</P>
<BR>

<br>http://www.bbc.co.uk/ - World Wide Wonderland<br><br>This e-mail (and=
 any attachments) is confidential and may contain<br>personal views which=
 are not the views of the BBC unless specifically<br>stated.<br>If you ha=
ve received it in error, please delete it from your system. <br>Do not us=
e, copy or disclose the information in any way nor act in<br>reliance on =
it and notify the sender immediately. Please note that the<br>BBC monitor=
s e-mails sent or received. <br>Further communication will signify your c=
onsent to this.</BODY>
</HTML>=

------_=_NextPart_001_01C46DB9.48B91826--

Can you $Class->update_all() ?
Ian McDonald-ONLINE 17:53 on 19 Jul 2004

Re: Can you $Class->update_all() ?
Perrin Harkins 18:01 on 19 Jul 2004

Re: Can you $Class->update_all() ?
Charles Bailey 18:13 on 19 Jul 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52