Re: Class::DBI::Relationship::IsA issues with create()

[prev] [thread] [next] [Date index for 2005/02/27]

From: Peter Speltz
Subject: Re: Class::DBI::Relationship::IsA issues with create()
Date: 03:17 on 27 Feb 2005
I don't notice a 
"__PACKAGE__->add_relationship_type('is_a' =>'Class::DBI::Relationship::IsA'); 
statment.

> > > #Tables
> > > package TestDBIsA::Person;
> > > use base qw(TestDBIsA::ClassDBI);
> > > 
> > > package TestDBIsA::Artist;
> > > use base qw(TestDBIsA::ClassDBI);

#    add_relaionship_type statement goes here

> > > TestDBIsA::Artist->is_a( 'pid' => 'TestDBIsA::Person' );
> > > 

> > 'Person', and everything works fine, but that when I call it on my child,
> > 'Artist', I get an error message.
> > > 
> > > TestDBIsA::Artist->create( {
> > >   artistid => 81,
> > >   alias => 'Manet',
> > >   pid => 2
> > >   }
> > > );
> > > 
> > > Can't insert new TestDBIsA::Person: DBD::Oracle::st execute failed:
> > > ORA-01400:
> > > cannot insert NULL into ("JLDOMMER"."PERSON"."PERSONID") (DBD ERROR:
> > > OCIStmtExecute) [for Statement "INSERT INTO person (personid)
> > > VALUES (?)
> > > "] at /usr/lib/perl5/site_perl/5.8.0/DBIx/ContextualFetch.pm line 51.
> > >  at /usr/lib/perl5/site_perl/5.8.0/Class/DBI/Relationship/IsA.pm line
> > > 257
> > > 

It looks like the IsA set the before create trigger in Artist to create the
person. Somereason the pid didn't get a value.  Does artist have a 'pid' column
specified in columns('All') ?



=====
pjs


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

Re: Class::DBI::Relationship::IsA issues with create()
Peter Speltz 03:17 on 27 Feb 2005

Generated at 17:56 on 01 Mar 2005 by mariachi v0.52