On Thu, 01 Mar 2007 09:44:37 -0500 Ted Zlatanov <[EMAIL PROTECTED]> wrote: 

TZ> On Wed, 28 Feb 2007 19:47:54 -0500 Jonathan Vanasco <[EMAIL PROTECTED]> 
wrote: 
JV> would it be possible to reserve a namespace within rose db objects  
JV> for user use?

JV> i need to cache some calculated data in an object for use over  
JV> multiple calls

TZ> You could use a TEMP column.  I don't know if it can be used to store
TZ> arbitrary data, but I don't remember such a limitation when I looked
TZ> at the code.  I hope I understood what you are asking.

Sorry, to clarify: those are not built-in to RDBO, you need something
like this in your base object class (John wrote this to help me a
while ago):

sub temp_columns
{
  my($class) = shift;
  
  my $columns = (@_ == 1 && ref $_[0] eq 'ARRAY') ? shift : [EMAIL PROTECTED];

  Rose::Object::MakeMethods::Generic->make_methods
  (
    { target_class => $class },
    scalar => [ grep { !$class->can($_) } @$columns ],
  );
}

sub Rose::DB::Object::Metadata::temp_columns
{
  shift->class->temp_columns(@_);
}

Use with "temp_columns => [qw/a b c/]" in the metadata setup.

caveat: this just stores entries in the hash, so you need to make sure
TEMP columns don't interfere with regular ones.  They are not columns
anyhow, just attributes, but I'm used to calling them TEMP columns
from the CDBI days...

Ted

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to