[hibernate-issues] [Hibernate-JIRA] Resolved: (EJB-415) setParameter does not work with enums

Gail Badner (JIRA) noreply at atlassian.com
Tue Feb 24 13:41:38 EST 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved EJB-415.
-----------------------------

      Assignee: Gail Badner
    Resolution: Rejected

> setParameter does not work with enums
> -------------------------------------
>
>                 Key: EJB-415
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-415
>             Project: Hibernate Entity Manager
>          Issue Type: Bug
>          Components: EntityManager
>    Affects Versions: 3.4.0.GA
>         Environment: Hibernate 3.3.1.GA, Oracle 9i
>            Reporter: ChB
>            Assignee: Gail Badner
>
> Let's imagine the following scenario:
> @Entity
> public class SomeClass {
>   @Id
>   private int id;
>   @Enumerated(EnumType.ORDINAL)
>   private SomeEnum value;
>   ...
> }
> And the following query
> em.createQuery("select entity from SomeClass as entity where entity.value = :pParam).setParam("pParam", SomeEnum.SOMEVALUE);
> This causes hibernate to serialize the enum and write it down to the db, while I actually expected it use the value of  @Enumerated(EnumType.ORDINAL)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list