Document the relationship declaration limitation.
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat.pm
index 874c4c7..afc89f2 100644 (file)
@@ -15,7 +15,6 @@ __PACKAGE__->load_own_components(qw/
   Constraints
   Triggers
   ReadOnly
-  GetSet
   LiveObjectIndex
   AttributeAPI
   Stringify
@@ -23,16 +22,20 @@ __PACKAGE__->load_own_components(qw/
   Constructor
   AccessorMapping
   ColumnCase
-  HasA
-  HasMany
-  MightHave
+  Relationships
+  Copy
   LazyLoading
   AutoUpdate
   TempColumns
+  GetSet
   Retrieve
   Pager
   ColumnGroups
-  ImaDBI/);
+  ColumnsAsHash
+  AbstractSearch
+  ImaDBI
+  Iterator
+/);
 
             #DBIx::Class::ObjIndexStubs
 1;
@@ -49,10 +52,11 @@ DBIx::Class::CDBICompat - Class::DBI Compatibility layer.
 =head1 DESCRIPTION
 
 DBIx::Class features a fully featured compatibility layer with L<Class::DBI>
-to ease transition for existing CDBI users. In fact, this class is just a
-receipe containing all the features emulated. If you like, you can choose
-which features to emulate by building your own class and loading it like
-this:
+and L<Class::DBI::AbstractSearch> to ease transition for existing CDBI users. 
+
+In fact, this class is just a receipe containing all the features emulated.
+If you like, you can choose which features to emulate by building your 
+own class and loading it like this:
 
   __PACKAGE__->load_own_components(qw/CDBICompat/);
 
@@ -68,58 +72,60 @@ provided it looks something like this:
     CDBICompat::MightHave
   /);
 
-=head1 COMPONENTS
-
-=over 4
-
-=item AccessorMapping
-
-=item AttributeAPI
+=back
 
-=item AutoUpdate
+=head1 LIMITATIONS
 
-Allows you to turn on automatic updates for column values.
+=head2 Unimplemented
 
-=item ColumnCase
+The following methods and classes are not emulated, maybe in the future.
 
-=item ColumnGroups
+=over 4
 
-=item Constraints
+=item Class::DBI::Query
 
-=item Constructor
+Deprecated in Class::DBI.
 
-=item DestroyWarning
+=item Class::DBI::Column
 
-=item GetSet
+Not documented in Class::DBI.  CDBICompat's columns() returns a plain string, not an object.
 
-=item HasA
+=item data_type()
 
-=item HasMany
+Undocumented CDBI method.
 
-=item ImaDBI
+=back
 
-=item LazyLoading
+=head2 Limited Support
 
-=item LiveObjectIndex
+The following elements of Class::DBI have limited support.
 
-The live object index tries to ensure there is only one version of a object
-in the perl interpreter.
+=over 4
 
-=item MightHave
+=item Class::DBI::Relationship
 
-=item ObjIndexStubs
+The semi-documented Class::DBI::Relationship objects returned by C<meta_info($type, $col)> are mostly emulated except for their C<args> method.
 
-=item ReadOnly
+=item Relationships
 
-=item Retrieve
+Relationships between tables (has_a, has_many...) must be delcared after all tables in the relationship have been declared.  Thus the usual CDBI idiom of declaring columns and relationships for each class together will not work.  They must instead be done like so:
 
-=item Stringify
+    package Foo;
+    use base qw(Class::DBI);
+    
+    Foo->table("foo");
+    Foo->columns( All => qw(this that bar) );
 
-=item TempColumns
+    package Bar;
+    use base qw(Class::DBI);
+    
+    Bar->table("bar");
+    Bar->columns( All => qw(up down) );
 
-=item Triggers
+    # Now that Foo and Bar are declared it is safe to declare a
+    # relationship between them
+    Foo->has_a( bar => "Bar" );
 
-=item PassThrough
 
 =back