[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5282) Query Parameters not supported for Entity Type Expression

Ted Young (JIRA) noreply at atlassian.com
Mon Aug 8 16:03:03 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43191#comment-43191 ] 

Ted Young commented on HHH-5282:
--------------------------------

For what it is worth, you can at least get access to the discriminator by exposing it as a private read-only property.  I wrote up an example here:

http://tedyoung.me/2011/08/08/jpa-and-hibernate-problems-with-polymorphic-queries/

This was particularly important for me where I had to group by and order by type.  It isn't perfect, though.  Note the issues described at the end of the article.  But, it works for now.

> Query Parameters not supported for Entity Type Expression
> ---------------------------------------------------------
>
>                 Key: HHH-5282
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5282
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: entity-manager
>    Affects Versions: 3.5.2
>            Reporter: Simon Martinelli
>            Assignee: Gail Badner
>         Attachments: query-test-type-expression.patch
>
>
> Trying to use Entity Type Expression with query parameter result in an exception:
> org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : near line 1, column 90 [select k from ch.bkw.zlsc.domain.stammdaten.vse.VSEStatistikKategorie k where TYPE(k) in :typs and k.sortierung like :keyword]
> Using dynamic query instead of parameters works.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list