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

ChB (JIRA) noreply at atlassian.com
Tue Feb 24 05:13:39 EST 2009


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


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