]
Emmanuel Bernard moved HCANN-13 to HHH-4984:
--------------------------------------------
Key: HHH-4984 (was: HCANN-13)
Project: Hibernate Core (was: Hibernate Commons Annotations)
When mapping a domain on getter methods, if a @Formula is not in
order with the other get methods, Hibernate generates an AND statement for the formula
-------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-4984
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4984
Project: Hibernate Core
Issue Type: Bug
Environment: Oracle 10g, Hibernate 3
Reporter: Fabio Schmitz Tani
When mapping a domain on getter methods, if a @Formula is not in order with the other get
methods, Hibernate generates an AND statement for the formula.
For example, a domain with 2 fields and a formula field:
<code>
private Integer id;
private String text;
private Integer countField;
@Id
@Column(name = "id")
public Integer getId()...
@Column(name = "text")
public String getText()...
public void setId(Integer id)...
public void setText(String txt)...
@Formula("(select count(*) from other table)")
public Integer getCount()...
public void setCount(Integer count)....
</code>
When searching with Criteria, Hibernate adds the Formula in the query as a requirement:
select this_.id, this_.txt, (select count(*) from other table) as count from table this_
where id = ? and ((select count(*) from other table)=?)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: