Restore ability to handle underdefined root (t/prefetch/incomplete.t)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Manual / FAQ.pod
index 4a9eb18..051ae30 100644 (file)
@@ -134,8 +134,8 @@ as you like. See L<DBIx::Class::Relationship::Base>.
 
 =item .. define a relationship bridge across an intermediate table? (many-to-many)
 
-The term 'relationship' is used loosely with many_to_many as it is not considered a 
-relationship in the fullest sense.  For more info, read the documentation on L<DBIx::Class::Relationship/many_to_many>.  
+The term 'relationship' is used loosely with many_to_many as it is not considered a
+relationship in the fullest sense.  For more info, read the documentation on L<DBIx::Class::Relationship/many_to_many>.
 
 =item .. stop DBIx::Class from attempting to cascade deletes on my has_many and might_have relationships?
 
@@ -304,7 +304,7 @@ Use the L<DBIx::Class::ResultSet/rows> and
 L<DBIx::Class::ResultSet/order_by> attributes to order your data and
 pick off a single row.
 
-See also L<DBIx::Class::Manual::Cookbook/Retrieve_one_and_only_one_row_from_a_resultset>.
+See also L<DBIx::Class::Manual::Cookbook/Retrieve one and only one row from a resultset>.
 
 A less readable way is to ask a regular search to return 1 row, using
 L<DBIx::Class::ResultSet/slice>:
@@ -351,7 +351,7 @@ C<count> on the resultset will only return the total number in the page.
 =item .. insert a row with an auto incrementing primary key?
 
 This happens automatically. After
-L<creating|DBIx::Class::ResultSet/create> a row object, the primary
+L<creating|DBIx::Class::ResultSet/create> a result object, the primary
 key value created by your database can be fetched by calling C<id> (or
 the access of your primary key column) on the object.
 
@@ -437,8 +437,8 @@ data out.
 
 =head2 Custom methods in Result classes
 
-You can add custom methods that do arbitrary things, even to unrelated tables. 
-For example, to provide a C<< $book->foo() >> method which searches the 
+You can add custom methods that do arbitrary things, even to unrelated tables.
+For example, to provide a C<< $book->foo() >> method which searches the
 cd table, you'd could add this to Book.pm:
 
   sub foo {
@@ -455,7 +455,7 @@ methods to find or create data in related tables for you. But if you want to
 write your own methods, you can.
 
 For example, to provide a C<< $book->foo() >> method to manually implement
-what create_related() from L<DBIx::Class::Relationship::Base> does, you could 
+what create_related() from L<DBIx::Class::Relationship::Base> does, you could
 add this to Book.pm:
 
   sub foo {
@@ -473,25 +473,25 @@ Invoked like this:
 
 =item How do I store my own (non-db) data in my DBIx::Class objects?
 
-You can add your own data accessors to your classes.
+You can add your own data accessors to your Result classes.
 
 One method is to use the built in mk_group_accessors (via L<Class::Accessor::Grouped>)
 
-       package MyTable;
+       package App::Schema::Result::MyTable;
 
-       use parent 'DBIx::Class';
+       use parent 'DBIx::Class::Core';
 
        __PACKAGE__->table('foo'); #etc
        __PACKAGE__->mk_group_accessors('simple' => qw/non_column_data/); # must use simple group
 
 An another method is to use L<Moose> with your L<DBIx::Class> package.
 
-       package MyTable;
+       package App::Schema::Result::MyTable;
 
        use Moose; # import Moose
        use Moose::Util::TypeConstraint; # import Moose accessor type constraints
 
-       extends 'DBIx::Class'; # Moose changes the way we define our parent (base) package
+       extends 'DBIx::Class::Core'; # Moose changes the way we define our parent (base) package
 
        has 'non_column_data' => ( is => 'rw', isa => 'Str' ); # define a simple attribute
 
@@ -536,7 +536,7 @@ L<DBIx::Class> runs the actual SQL statement as late as possible, thus
 if you create a resultset using C<search> in scalar context, no query
 is executed. You can create further resultset refinements by calling
 search again or relationship accessors. The SQL query is only run when
-you ask the resultset for an actual row object.
+you ask the resultset for an actual result object.
 
 =item How do I deal with tables that lack a primary key?
 
@@ -556,7 +556,7 @@ Look at the tips in L<DBIx::Class::Manual::Cookbook/"STARTUP SPEED">
 =item How do I reduce the overhead of database queries?
 
 You can reduce the overhead of object creation within L<DBIx::Class>
-using the tips in L<DBIx::Class::Manual::Cookbook/"Skip row object creation for faster results">
+using the tips in L<DBIx::Class::Manual::Cookbook/"Skip result object creation for faster results">
 and L<DBIx::Class::Manual::Cookbook/"Get raw data for blindingly fast results">
 
 =item How do I override a run time method (e.g. a relationship accessor)?
@@ -567,12 +567,12 @@ The code example works for both modules:
 
     package Your::Schema::Group;
     use Class::Method::Modifiers;
-    
+
     # ... declare columns ...
-    
+
     __PACKAGE__->has_many('group_servers', 'Your::Schema::GroupServer', 'group_id');
     __PACKAGE__->many_to_many('servers', 'group_servers', 'server');
-    
+
     # if the server group is a "super group", then return all servers
     # otherwise return only servers that belongs to the given group
     around 'servers' => sub {
@@ -592,12 +592,12 @@ L<Method::Signatures::Simple> way:
 
     package Your::Schema::Group;
     use Method::Signatures::Simple;
-    
+
     # ... declare columns ...
-    
+
     __PACKAGE__->has_many('group_servers', 'Your::Schema::GroupServer', 'group_id');
     __PACKAGE__->many_to_many('servers', 'group_servers', 'server');
-    
+
     # The method keyword automatically injects the annoying my $self = shift; for you.
     method servers {
         return $self->result_source->schema->resultset('Server')->search({ ... });
@@ -607,17 +607,17 @@ The dirty way:
 
     package Your::Schema::Group;
     use Sub::Name;
-    
+
     # ... declare columns ...
-    
+
     __PACKAGE__->has_many('group_servers', 'Your::Schema::GroupServer', 'group_id');
     __PACKAGE__->many_to_many('servers', 'group_servers', 'server');
-    
+
     *servers = subname servers => sub {
         my $self = shift;
         return $self->result_source->schema->resultset('Server')->search({ ... });
     };
-    
+
 =back
 
 =head2 Notes for CDBI users