Hibernate gets the "extra" keywords from java.sql.DatabaseMetaData.getSQLKeywords(), but that doesn't get the ANSI 2003 keywords. It does not seem to track the ANSI SQL keywords unless explicitly specified by the dialect.
There's a comment in JdbcEnvironmentImpl: // todo : should really maintain a standard list of know ANSI-SQL defined keywords somewhere (currently rely on Dialect) private final Set<String> reservedWords = new HashSet<String>();
Should these keywords be added directly to Dialect, or should they be dialect-specific?
This can be reproduced using SQLServer2012Dialect: * org.hibernate.test.collection.original.CollectionTest fails if the table mapping for "User" entity is removed from hibernate-core/src/test/java/org/hibernate/test/collection/original/UserPermissions.hbm.xml (USER is an ANSI SQL reserved word); * ASTParserLoadingTest.testJPAQLQualifiedIdentificationVariablesControl() fails if the column mapping for VariousKeywordPropertyEntity.key is removed from hibernate-core/src/test/java/org/hibernate/test/hql/VariousKeywordPropertyEntity.hbm.xml
|