Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Greenhorn
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.
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic