This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can i delete an object based on his reference

 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I am working with Jboss 4.2 (JPA ).

when i try to execute the following query:
delete from DeviceConfigurationElements a where a.deviceDescriptor.macAddress = '02-00-4C-4F-4F-50'


I get an exception of sql syntax error , because it generate the following query:

20:52:23,804 INFO [STDOUT] Hibernate: delete from DeviceConfigurationElements, DeviceDescriptor devicedesc1_ where macaddress='02-00-4C-4F-4F-50'

20:52:23,819 WARN [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000

20:52:23,819 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right sy

ntax to use near 'where macaddress='02-00-4C-4F-4F-50'' at line 1
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!