On 01/29/2008 12:47 PM, Chris Jacobson wrote:
> Hello Rose List!
> 
> Is there a way, using Rose::DB::Object::Loader, that the generated  
> classes can be instructed to include the 'schema' meta value?  I took  
> a peek under the hood, and can't figure out the proper place that a  
> patch would have to be applied to add an option such as  
> 'include_schema', or something similar.
> 

I tend to have my schema setting at an intermediate class between the 'table' 
class and my
main RDBO class. If you look at Rose::DBx::Garden, that's the convention used 
there.

What that means in this case is that you can set your schema in one place, 
rather than in
each table class.

e.g.:

 MyRDBO.pm
   MyRDBO/MySchema.pm
     MyRDBO/MySchema/MyTable1.pm
     MyRDBO/MySchema/MyTable2.pm

Then MyRDBO::MySchema is simply:

 package MyRDBO::MySchema;
 use base qw( MyRDBO );
 sub schema { 'my_schema' }
 1;

And each ::MyTable* class inherits from MyRDBO::MySchema. That lets you 
override other
schema-wide behaviour as well.

I do not believe the Loader supports generating code with the schema set (I 
could be
wrong). But if you used Rose::DBx::Garden, you would get it set for you -- look 
at the
find_schemas feature.

-- 
Peter Karman  .  [EMAIL PROTECTED]  .  http://peknet.com/


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to