• 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic