We're updating the issue view to help you get more done. 

Wrong SQL generated for delete with where crossing tables (derby, although hsqldb ALSO broken :()

Description

I'm trying to run this query:

delete StoredMessagePendingClient m where m.clientId = :clientid and m.message.messageId = :messageid

This generates the following SQL, which fails under derby because derby doesn't accept two tables seperated by a comma (I'm anyway not trying to delete from both tables, only from the first one, so that SQL is wrong).

Hibernate: delete from MESSAGES_PENDINGCLIENT, MESSAGES storedmess1_ where CLIENT_ID=? and ID=?

WARN: SQL Error: 20000, SQLState: 42X01
Apr 05, 2015 5:32:05 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: Syntax error: Encountered "," at line 1, column 35.

Also note the same query also fails under hsqldb for different reasons (going to create another issue for it) so it's REALLY annoying

Environment

derby 10.11.1.1 and 10.7.1.1 both

Status

Assignee

Unassigned

Reporter

ymenageru

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.6
4.3.8
5.0.1

Priority

Major