Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Invalid MySQL syntax when using 'select new list()'

Svante Paldan
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate version: 3.3.1 GA
MySQL Version: 5.1.34-community
JDBC Connector: mysql-connector-java-5.1.7
Dialect: org.hibernate.dialect.MySQL5InnoDBDialect

I have a HQL query that looks like this:

Where receivedTransactions and sentTransactions both are of type A or B both inheriting (EJB3 single-table style) from Transaction.
CustomerAccount is inheriting from TransactionAgent. (This should explain the quirks of the SQL below)
So I'm hoping for the list returned to contain objects of type Transaction.

However, as this HQL query is executed, it's generating the following SQL:

Which causes an exception:

Has anyone seen this issue with the "new list" clause in selects? Is it a known issue? I've tried looking around the JIRA db but haven't really found anything useful... Any ideas of work-arounds?
Using only "select ca.receivedTransactions, ca.sentTransactions ..." works, but it (as expected) returns Object[] which is not the behaviour I'm looking for.
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!