[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4916) Literal with JDBC escape syntax for date doesn't work

Juergen Zimmermann (JIRA) noreply at atlassian.com
Sat Feb 13 02:31:29 EST 2010


Literal with JDBC escape syntax for date doesn't work
-----------------------------------------------------

                 Key: HHH-4916
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4916
             Project: Hibernate Core
          Issue Type: Bug
          Components: entity-manager
    Affects Versions: 3.5.0-CR-1
            Reporter: Juergen Zimmermann


I'm having an entity with a java.util.Date attribute:
@Entity
public class Kunde implements Serializable {
	@Temporal(DATE)
	private Date seit;
	...
}

The following named query crashes, when a Date literal is used for parameter instantiation:
SELECT k
FROM  Kunde k 
WHERE k.seit = :seit

Here is the stacktrace:
java.lang.IllegalArgumentException: Parameter value [{d '2001-01-31'}] was not matching type [java.util.Date]
	at org.hibernate.ejb.AbstractQueryImpl.registerParameterBinding(AbstractQueryImpl.java:354)
	at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:354)
	at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:71)

-- 
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