Re: EO_PK_TABLE not being created
Cord Sengbusch <[email protected]> Sun, 4 Sep 2011 23:40:33 -0400
| Newsgroups | gmane.comp.web.webobjects.woproject.devel |
|---|---|
| Message-ID | <CAKdLKuQfvk_dtSVy7XGBP=5-hQcYvemzMiLQ8QL_LOjmO6SdWQ@mail.gmail.com> |
--0015175cfe482d7ff304ac297906 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Pascal - Thanks for the help. I created my database first, then the EOs, which then missed the creation of the eo_pk_table. I created the eo_pk_table using your suggestion, and was finally able to insert a row into the database. Thank you for your help and next time I will create the database from Entit= y Modeler, and follow the 'normal' development. Cord On Sat, Sep 3, 2011 at 4:17 PM, Pascal Robert <[email protected]> wrote: > > Le 2011-09-03 =E0 15:49, Mike Warren a =E9crit : > > Cord, > > The default behavior I see for creating new EOs is with the selection of = a > primary key from a db sequence. > > > That's the default behavior if the RDBMs support sequences, and MySQL > doesn't. You have to create the EO_PK_TABLE by using the SQL generation i= n > Entity Modeler and select "Create primary support", it will generate the > correct SQL code to create the table. > > An easy test would be to create a sequence named registration_seq (for db > table registration) and the primary key should be auto created for you > during your insert. The other controls for primary key are found in the > Entity Modeler app. > > Hope this helps, > Mike > > On Sep 3, 2011, at 12:39 PM , "Cord Sengbusch" <[email protected]> > wrote: > > Hi All - > > I am using Eclipse, WOLips, WebObjects 5.3.3 and MySQL for a small projec= t. > > I am able to query tables in my database, but as soon as I try to insert = a > row using my WebObjects application, I get the following exception: > > *Error:*java.lang.IllegalStateException: Adaptor > com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf03 failed to provide new > primary keys for entity 'Registration' *Reason:*Adaptor > com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf03 failed to provide new > primary keys for entity 'Registration' > > In Entity Modeler I have com.webobjects.jdbcadaptor.MySQLPlugIn as the th= e > Plugin in the config file. > > When viewing my database I do not see an EO_PK_TABLE. > > Not sure how to get my application to create/use the eo_pk_table. > > Thanks for the help. > > Cord > > > --0015175cfe482d7ff304ac297906 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Pascal -<div><br></div><div>Thanks for the help. I created my database firs= t, then the EOs, which then missed the creation of the eo_pk_table.</div><d= iv><br></div><div>I created the eo_pk_table using your suggestion, and was = finally able to insert a row into the database.</div> <div><br></div><div>Thank you for your help and next time I will create the= database from Entity Modeler, and follow the 'normal' development.= </div><div><br></div><div>Cord</div><div><br><br><div class=3D"gmail_quote"= > On Sat, Sep 3, 2011 at 4:17 PM, Pascal Robert <span dir=3D"ltr"><<a href= =3D"mailto:[email protected]">[email protected]</a>></span> wrote:<br><blo= ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c= cc solid;padding-left:1ex;"> <div style=3D"word-wrap:break-word"><br><div><div>Le 2011-09-03 =E0 15:49, = Mike Warren a =E9crit :</div><div class=3D"im"><br><blockquote type=3D"cite= "><div bgcolor=3D"#FFFFFF"><div>Cord,</div><div><br></div><div>The default = behavior I see for creating new EOs is with the selection of a primary key = from a db sequence. =A0</div> </div></blockquote><div><br></div></div><div>That's the default behavio= r if the RDBMs support sequences, and MySQL doesn't. You have to create= the EO_PK_TABLE by using the SQL generation in Entity Modeler and select &= quot;Create primary support", it will generate the correct SQL code to= create the table.</div> <div><div></div><div class=3D"h5"><br><blockquote type=3D"cite"><div bgcolo= r=3D"#FFFFFF"><div>An easy test would be to create a sequence named registr= ation_seq (for db table registration) and the primary key should be auto cr= eated for you during your insert. =A0The other controls for primary key are= found in the Entity Modeler app.=A0<br> <br>Hope this helps,<br><div>Mike</div></div><div><br>On Sep 3, 2011, at 12= :39 PM , "Cord Sengbusch" <<a href=3D"mailto:[email protected]"= target=3D"_blank">[email protected]</a>> wrote:<br><br></div><div= ></div><blockquote type=3D"cite"><div>Hi All -<div><br></div><div>I am usin= g Eclipse, WOLips, WebObjects 5.3.3 and MySQL for a small project.</div> <div><br></div><div>I am able to query tables in my database, but as soon a= s I try to insert a row using my WebObjects application, I get the followin= g exception:</div> <div><br></div><div><span style=3D"font-family:Times;font-size:medium"><tab= le border=3D"0" width=3D"100%"><tbody><tr><td align=3D"right" valign=3D"top= " height=3D"13"> <b>Error:</b></td><td align=3D"left" valign=3D"top" height=3D"13">java.lang= .IllegalStateException: Adaptor com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf= 03 failed to provide new primary keys for entity 'Registration'</td= > </tr> <tr><td align=3D"right" valign=3D"top"><b>Reason:</b></td><td align=3D"left= " valign=3D"top">Adaptor com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf03 fail= ed to provide new primary keys for entity 'Registration'<br></td></= tr> </tbody></table> <br></span></div><div><span style=3D"font-family:Times;font-size:medium">In= Entity Modeler I have=A0com.webobjects.jdbcadaptor.MySQLPlugIn as the the = Plugin in the config file.</span></div> <div><span style=3D"font-family:Times;font-size:medium"><br></span></div><d= iv><font face=3D"Times" size=3D"3"><span>When viewing my database I do not = see an EO_PK_TABLE.</span></font></div> <div><font face=3D"Times" size=3D"3"><span><br></span></font></div><div><sp= an style=3D"font-family:Times;font-size:medium">Not sure how to get my appl= ication to create/use the eo_pk_table.</span></div> <div><span style=3D"font-family:Times;font-size:medium"><br></span></div><d= iv><span style=3D"font-family:Times;font-size:medium">Thanks for the help.<= /span></div> <div><span style=3D"font-family:Times;font-size:medium"><br></span></div><d= iv><span style=3D"font-family:Times;font-size:medium">Cord</span></div> </div></blockquote></div></blockquote></div></div></div><br></div></blockqu= ote></div><br></div> --0015175cfe482d7ff304ac297906--