• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EOModeler syntax error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOModeler syntax error


  • Subject: Re: EOModeler syntax error
  • From: Jonathan Rochkind <email@hidden>
  • Date: Thu, 4 Mar 2004 11:19:22 -0600

If you're doing schema synchronization stuff from EOModeler, than EOModeler is generating the code with the help of the specified JDBC Driver and (WebObjects) JDBCPlugIn class. It's potentially possible to change the SQL generated by writing your own JDBCPlugIn class, or sub-classing/modifying one supplied by Apple or a third party. Some SQL changes are more feasible than others through this mechanism. Messing with JDBCPlugIn subclasses (and worse, with EOSQLExpression subclass, which sometimes is also neccesary) can get tricky sometimes.

[If you are developing on Windows, it's even trickier, because Windows EOModeler requires a Java 1.1.8 compatible JDBC driver and JDBCPlugIn class, while your runtime app wants Java 1.3.1 or 1.4.1 depending on WO version.]

Of course, the SQL generated at run-time by your app itself also uses the JDBC Driver and JDBCPlugIn, but there are other potential hooks to effect SQL generation in a run-time WO/EOF app. As far as EOModeler, the JDBC Driver and JDBCPlugIn class are your only available points.

--Jonathan

At 12:03 PM -0500 3/4/04, Ben Schwartz wrote:
Ok, thanks I'm going to try it like that - but is there a way to edit the
SQL syntax - I'd just like to know in general, as in this case just adding a
space would fix the problem.

Thank you,

Ben


On 3/4/04 11:57, "Kieran Kelleher" <email@hidden> wrote:

 USER is a reserved word in MySQL (a function actually), so change it to
 something else for that table.


________________________________________________________________ Config = OS X 10.3.2 / Java 1.4.1 / WO 5.2.2 / MySQL 4.0.18 / Connector-J 3.0.11 Blog: http://webobjects.webhop.org/


On Mar 4, 2004, at 11:13 AM, Ben Schwartz wrote:

 Hi,

 I'm new to the WO world and I'm trying out some code generation with
 EOModeler.
 I created a model of a MySQL table in there, and saved that model - I
 then
 wanted to start populating that db so I decided to use the "Display
 Group
 Component" within New Project > Display Group Component in Xcode. It
 works
 great and makes a page where I should be able to insert new records in
 the
 DB. Unfortunately when I input a new record and tell it to save to the
 db
 here is the error message I get:

 Error:     com.webobjects.eoaccess.EOGeneralAdaptorException:
 EvaluateExpression failed: : Next exception:SQL State:42000 -- error
 code:
 1064 -- msg: Syntax error or access violation: You have an error in
 your SQL
 syntax near 'User(pk, password, username) VALUES (1, 'password',
 'ben')' at
 line 1

 The reason why that syntax is wrong is because there is no space
 between
 "User" and the first "(" . The problem is that the SQL syntax is
 generated
 by either Xcode or EOModeler - I don't know which one and that's where
 I
 need help. Is there something I am doing wrong for the syntax to be
 wrong
 and is there a place where I could manually change it for the syntax
 to be
 correct?

 Thanks very much in advance for your help,

 -Ben
 _______________________________________________
 webobjects-dev mailing list | email@hidden
 Help/Unsubscribe/Archives:
 http://www.lists.apple.com/mailman/listinfo/webobjects-dev
 Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: EOModeler syntax error (From: Ben Schwartz <email@hidden>)

  • Prev by Date: Re: EOModeler syntax error
  • Next by Date: Re: Starting out
  • Previous by thread: Re: EOModeler syntax error
  • Next by thread: Re: EOModeler syntax error
  • Index(es):
    • Date
    • Thread