From: Mark W. <ma...@wa...> - 2009-02-27 22:12:45
|
Dear Chuck, Thanks for your reply. That had been my first thought, but checking and double checking the model from within eclipse showed that I had specified a column correctly (www.wardle.org/dev/eomodeler_problem.jpg). Indeed, I knew it must be correct, for I could generate both migrations and SQL appropriately. *However*, your message made me think again, so I had a dig into the the internals of the model: (www.wardle.org/dev/User.plist). No column specified, despite what it says within Eclipse. Quite how that happened I do not know. I've manually updated the plist, and no longer get that exception (*). Thank you Best wishes, Mark (*) I get a different exception now (NullPointerException), but that will require a bit of debugging on my part before I share it! 2009/2/27 Chuck Hill <ch...@gl...>: > > On Feb 27, 2009, at 10:09 AM, Mark Wardle wrote: > >> Dear all, >> >> I've been lurking on the webobjects and Project Wonder mailing lists >> for some time, and have been developing some toy applications with >> some minor success but haven't really got beyond experimenting. >> I would stress I remain a beginner (as will beclear!). >> >> This all used to work, but now I'm receiving the following message >> after executing a query: >> >> EOQualifier qual = >> User.EMAIL.eq(email).and(User.PASSWORD.eq(password)); >> User user = >> User.fetchRequiredUser(session().defaultEditingContext(), qual); >> ((Session) session()).setCurrentUser(user); >> errorMessage = "SUCCESS!"; >> >> er.transaction.adaptor.Exceptions - Database Exception occured: >> java.lang.IllegalStateException: sqlStringForAttribute: attempt to >> generate SQL for attribute 'id' on entity 'User' with undefined column >> name > > That is a problem in your model, not in the database. User.id in missing > the column name in the model. > > > Chuck > >> The user table is currently generated using migrations, auto-generated >> from within WOlips... >> ERXMigrationTable userTable = >> database.newTableNamed("t_user"); >> userTable.newStringColumn("email", 100, false); >> userTable.newStringColumn("first_names", 100, false); >> userTable.newIntegerColumn("id", false); >> userTable.newStringColumn("last_name", 100, false); >> userTable.newStringColumn("password", 100, false); >> userTable.newBooleanColumn("show_welcome", false); >> userTable.newStringColumn("title", 100, false); >> userTable.create(); >> userTable.setPrimaryKey("id"); >> >> And in postgresql: >> >> email | character varying(100) | not null >> first_names | character varying(100) | not null >> id | integer | not null default >> nextval('t_user_seq'::regclass) >> last_name | character varying(100) | not null >> password | character varying(100) | not null >> show_welcome | character varying(5) | not null >> title | character varying(100) | not null >> Indexes: >> "t_user_pk" PRIMARY KEY, btree (id) >> >> >> Against my better judgement, I modified a number of things at once and >> am not sure what is now going wrong. In one step I added a number of >> entities which used textual primary keys (but not to the User object) >> and switched from using downloaded Project Wonder binaries to using >> the svn source (trunk) and using the PW projects directly from within >> eclipse (I followed these instructions : >> >> http://wiki.objectstyle.org/confluence/display/WOL/Project+Wonder+woa+with+Linked+Source) >> >> I've since upgraded WO thinking it was a PW <-> WO versioning problem, >> but that didn't help. >> >> Rather than putting a huge log file in this email and polluting >> everyone's email boxes, I've uploaded my logfile to >> >> http://www.wardle.org/dev/problem.log.txt >> >> I have a feeling I'm missing something obvious here, so would >> appreciate any help - many thanks! >> >> Best wishes, >> >> Mark >> >> Webobjects 5.4.3 >> Java.version = 1.5.0_16", >> Mac OS X leopard 10.5.6 >> Project Wonder from svn >> WOlips >> >> -- >> Dr. Mark Wardle >> Specialist registrar, Neurology >> Cardiff, UK >> >> >> >> -- >> Dr. Mark Wardle >> Specialist registrar, Neurology >> Cardiff, UK >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Wonder-disc mailing list >> Won...@li... >> https://lists.sourceforge.net/lists/listinfo/wonder-disc >> > > -- > Chuck Hill Senior Consultant / VP Development > > Practical WebObjects - for developers who want to increase their overall > knowledge of WebObjects or who are trying to solve specific problems. > http://www.global-village.net/products/practical_webobjects > > > > > > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit > http://www.messagelabs.com/email______________________________________________________________________ > -- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK |