On 10/24/06 11:45 PM, Graham Barr wrote:
> The problem is that by default RDBO creates the metadata like
> 
>    foreign_keys => [
>      user => {
>        class       => 'MyClass::User',
>        key_columns => {
>          from_id => 'id',
>          to_id   => 'id',
>        },
>      },
>    ],

I think that's a bug in my treatment of MySQL's information schema support.
Are you by any chance using MySQl 5.0.6 or later?

> It also does not match what is described
> in the RDBO::Metadata pod under foreign_key_name_generator

The foreign_key_name_generator predates the convention manager, and sort of
conflicts with it.  Right now, the CM's auto_foreign_key_name() method gets
a first shot at naming foreign keys.  Only if it returns false does the
foreign_key_name_generator ever get called.

I'm not sure how to resolve this.  I'm leaning towards just ditching
foreign_key_name_generator entirely, since the algorithm in
auto_foreign_key_name() is a bit more sane, IMO.  Thoughts?

> Also, we are using ::Loader to generate our classes and I could not
> figure out how to use our own FK name generator, or as the ::Metadata
> pod suggests, intervene before initialize

Ignoring foreign_key_name_generator  for now, I suggest this: Create your
own custom ConventionManager subclass and override auto_foreign_key_name().
Then give the loader object your custom CM.

-John



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to