[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-647) @Where with boolean constraints does not work: @Where(clause = "cool = true") breaks
Geoffrey De Smet (JIRA)
noreply at atlassian.com
Wed Aug 8 08:59:13 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27771 ]
Geoffrey De Smet commented on ANN-647:
--------------------------------------
A workaround - on Mysql 5 at least ... - is using 1 instead of true:
@Where(clause = "cool = 1")
> @Where with boolean constraints does not work: @Where(clause = "cool = true") breaks
> ------------------------------------------------------------------------------------
>
> Key: ANN-647
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-647
> Project: Hibernate Annotations
> Issue Type: Bug
> Components: binder
> Affects Versions: 3.3.0.ga
> Environment: Mysql 5
> Reporter: Geoffrey De Smet
>
> The problem is that the "true" gets prefixed with the tablename:
> For example this is an annotated class
> @ManyToMany(targetEntity = ProjectPO.class, mappedBy="coolholders")
> @Where(clause = " cool = 'true' ")
> public List<Project> getInCoolProjects()
> Here's the generated SQL:
> ... where ( projectpo1_.cool = projectpo1_.true ) ...
> while it should probably be:
> ... where ( projectpo1_.cool = true ) ...
> PS: it's a bit unclear if @Where(clause) accepts SQL or HQL. If it's only SQL, allowing HQL too would be useful :)
--
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