Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Rose::DB::Object::Std::Cached
Memory cached standardized object representation of a single row in a database table.

Rose::DB::Object::Std::Cached - Memory cached standardized object representation of a single row in a database table.


NAME

Rose::DB::Object::Std::Cached - Memory cached standardized object representation of a single row in a database table.


SYNOPSIS


  package Category;

  use Rose::DB::Object::Std::Cached;

  our @ISA = qw(Rose::DB::Object::Std::Cached);

  __PACKAGE__->meta->table('categories');

  __PACKAGE__->meta->columns

  (

    id          => { type => 'int', primary_key => 1 },

    name        => { type => 'varchar', length => 255 },

    description => { type => 'text' },

  );

  __PACKAGE__->meta->add_unique_key('name');

  __PACKAGE__->meta->initialize;

  ...

  $cat1 = Category->new(id   => 123,

                        name => 'Art');

  $cat1->save or die $category->error;

  $cat2 = Category->new(id => 123);

  # This will load from the memory cache, not the database

  $cat2->load or die $cat2->error;

  # $cat2 is the same object as $cat1

  print "Yep, cached"  if($cat1 eq $cat2);

  # No, really, it's the same object

  $cat1->name('Blah');

  print $cat2->name; # prints "Blah"

  ...


DESCRIPTION

Rose::DB::Object::Std::Cached is a subclass of both the Rose::DB::Object::Std manpage and the Rose::DB::Object::Cached manpage. It simply combines the features of both classes. See the the Rose::DB::Object::Std manpage and the Rose::DB::Object::Cached manpage documentation for more information.


AUTHOR

John C. Siracusa (siracusa@gmail.com)


COPYRIGHT

Copyright (c) 2007 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy