On 10/24/05, Sean Davis <[EMAIL PROTECTED]> wrote:
>>   If the table has a foreign key, then define it with foreign_keys()
>>
>> Otherwise, feel free to use a "one to one" or "many to one" relationship.
>
> I assume that auto_initialize will do this automatically--all except the
> many-to-many?

Auto-init will initialize all the foreign key metadata, and it'll make
a "many to one" relationship for each foreign key found.  (Note: not
"one to one" because I currently don't rummage through indexes to try
to determine if it's possible for more than one row to have the same
foreign key value(s).  This is kind of a pain, particularly for
databases like Informix that do not readily reveal their schema
secrets.)

All other kinds of relationships must at least be hinted at
"manually"--a name and a type, at least.  The convention manager will
fill in the details, provided your tables and classes are named
according to its conventions.  If not, you must specify more
information.

As for the earlier error:

On 10/24/05, Sean Davis <[EMAIL PROTECTED]> wrote:
> Could not auto-generate foreign keys for class AnnoDB::Model::Gene::Alias -
> Missing or invalid key name '' for foreign key generated in
> AnnoDB::Model::Gene::Alias for AnnoDB::Model::Gene::Main at
> /Library/Perl/5.8.6/Rose/DB/Object/Metadata/Auto.pm line 432.

This turned out to be a bug.  Before the convention manager was added,
I used a different method to auto-generate foreign key names.  When I
added the convention manager, I forgot to remove the old code, and
they were kind of fighting with each other.

This fixed in CVS now.  I've emailed you a tarball separately.  If it
works for you, I'll release it to CPAN as 0.78.  (It's got one new
feature too...oh, the suspense ;)

-John


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to