Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Issues List »

[hibernate-issues] [Hibernate-JIRA] Moved: (HHH-4984) 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

Anupam M (JIRA)

2010-03-09


Author LoginPost Reply

  [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

   
_______________________________________________
hibernate-issues mailing list
hibernate-issues@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-issues
©2008 gg3721.com - Jax Systems, LLC, U.S.A.