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

Juergen Zimmermann (JIRA) noreply at atlassian.com
Sat Feb 13 20:07:30 EST 2010


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

Juergen Zimmermann commented on HHH-4916:
-----------------------------------------

Uups, you are right. JDBC escape syntax can't be used in prepared statements. Sorry, but I cannot reject this issue. Can you do so, please?

> 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
>            Assignee: Steve Ebersole
>
> 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