[hibernate-dev] Various "row value construct" alike syntax and Dialect class

Łukasz Antoniak lukasz.antoniak at gmail.com
Fri May 25 15:19:29 EDT 2012


Hello Community,

Really quick question. There are quite few SQL syntax tricks similar to "row value construct".

CREATE TABLE test ( a1 NUMBER, b1 NUMBER );
SELECT * FROM test WHERE (a1, b1) = ( 1, 1 ); -- Fails on Oracle
SELECT * FROM test WHERE (a1, b1) IN ( ( 1, 1 ), ( 2, 2 ) ); -- Passes on Oracle
SELECT * FROM test WHERE (a1, b1) = ( SELECT 1, 1 FROM dual ); -- Passes on Oracle
SELECT * FROM test WHERE (a1, b1) IN ( SELECT 1, 1 FROM dual ); -- Passes on Oracle

Oracle does not support "row value syntax" as shown in the first query (Dialect#supportsRowValueConstructorSyntax() has to return 
false).

Should I assume that second, third and fourth query ought to pass when Dialect#supportsRowValueConstructorSyntaxInInList() returns 
positive? Or shall I add another method to Dialect class like supportsRowValueConstructorSyntaxInSelectList()? Please advise. I 
just do not want the Dialect class to grow and grow. Dialect#supportsRowValueConstructorSyntaxInInList() is overridden only by 
Oracle dialect, but PostgreSQL supports this feature as well.

Regards,
Lukasz Antoniak


More information about the hibernate-dev mailing list