Exception in thread "main" java.lang.IllegalArgumentException: You have attempted to set a parameter at position 1 which does not exist in this query string DELETE FROM Employee e WHERE e.employeeID > 0.
There should not be need for setting any parameters. Try also adding alias after DELETE DELETE e FROM Employee e WHERE e.employeeID > 0
[ January 20, 2008: Message edited by: Vesa Tanhua-Tyrkk� ] [ January 20, 2008: Message edited by: Vesa Tanhua-Tyrkk� ]
I tried DELETE e FROM Employee WHERE e.employeeID > 0:
So I take out the e and I get:
Now why is it trying to bind? Presently I'm not binding anything. Hmmm. OK, I'll bind with this code:
And, I already tried "delete FROM Employee WHERE EmployeeID >0". I tried it with capitalizing the first letter in employeeID and not capitalizing. Neither worked.
No matter what I try, I just cannot seem to win! Thanks, Siegfried
Here is the stack trace:
[ January 20, 2008: Message edited by: Siegfried Heintze ]
Sorry I didn't notice this thread again since I last responded, but after you fixed the syntax problem in your query then what you saw next was an exception indicating that it couldn't find the DTYPE column in your table. That just means that you have an inconsistency between your table and your mappings.
DTYPE is the default discriminator column name used for inheritance hierarchies (its value in a db row indicates the java class that the row maps to). It looks as if you mapped an inheritance hierarchy to existing tables but didn't map the discriminator column, so it is defaulting to DTYPE (but you don't have a column of that name in your table). If you had auto-generated the tables then it would have been created for you. Assuming that you have a discriminator column in your table then you can map it using the @DiscriminatorColumn annotation.
I am able to make class messages a descendant of class greeting where class message as the additional data members of src and dst. While my example works (I have an instance of a descendant class that will display the src and dst), I cannot find the src and dst fields in the MySQL Client SQL browser! Using the SQuirreL browser did not help either! Anyway, it must be there somewhere!
Now I need to figure out the difference between the example that works and the example that does not work.
Thanks everyone for your help! Siegfried
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss