GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ORYX::SCHEMA (3)

.ds Aq ’

NAME

Oryx::Schema - Schema class for Oryx

CONTENTS

SYNOPSIS



  package CMS::Schema;

  # enable auto deploy for all classes
  use Oryx::Class(auto_deploy => 1);
  
  # useful if you want to say $storage->deploySchema(CMS::Schema);
  use CMS::Page;
  use CMS::Paragraph;
  use CMS::Image;
  use CMS::Author;
  
  sub prefix { cms }

  1;

  #==================================================================
  # ALTERNATIVE - With XML::DOM::Lite installed
  #==================================================================
  package CMS::Schema;
  use base qw(Oryx::Schema);
  1;
  __DATA__
  <Schema>
    <Class name="CMS::Page">
      <Attribute name="title" type="String"/>
      <Attribute name="num" type="Integer"/>
      <Association role="author" class="CMS::Author"/>
    </Class>
    <Class name="CMS::Author">
      <Attribute name="first_name" type="String"/>
      <Attribute name="last_name" type="String"/>
    </Class>
  </Schema>
  use CMS::Schema;
  
  my $cms_storage = Oryx->connect(\@conn, CMS::Schema);
  CMS::Schema->addClass(CMS::Revision);
  my @cms_classes = CMS::Schema->classes;
  $cms_storage->deploySchema();                 # deploys only classes seen by CMS::Schema
  $cms_storage->deploySchema(CMS::Schema)     # same thing, but `uses CMS::Schema first
  my $name = CMS::Schema->name;                 # returns CMS_Schema
  CMS::Schema->hasClass($classname);            # true if seen $classname



DESCRIPTION

Schema class for Oryx.

The use of this class is optional.

The intention is to allow arbitrary grouping of classes into different namespaces to support simultaneous use of different storage backends, or for having logically separate groups of classes in the same database, but having table names prefixed to provide namespace separation.

SEE ALSO

Oryx, Oryx::Class

AUTHOR

Copyright (C) 2005 Richard Hundt <richard NO SPAM AT protea-systems.com>

LICENSE

This library is free software and may be used under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ORYX::SCHEMA (3) 2006-05-31

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.