[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4382) @ManyToOne not working wth @Formula

Ravi Hasija (JIRA) noreply at atlassian.com
Sun Sep 13 11:29:00 EDT 2009


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

Ravi Hasija commented on HHH-4382:
----------------------------------

I just voted for this issue. I am not sure if there is any traction on this. With the legacy database that I am working with, lack of this feature is driving me to use hbm's instead of annotations. I love annotations and would really appreciate if I could use it for my current scenario. Is this feature in the road map? Just curious.

Many thanks for the work you guys have been putting forth!!! Much appreciated!!



> @ManyToOne not working wth @Formula
> -----------------------------------
>
>                 Key: HHH-4382
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4382
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: annotations
>         Environment: Hibernate 3.1,  PostgreSQL 8.1.1
>            Reporter: Steve Ebersole
>
> This type of mapping fails:
> @ManyToOne 
> @Formula(value="( select v_pipe_offerprice.offerprice_fk from v_pipe_offerprice where v_pipe_offerprice.id = id )") 
> public OfferPrice getOfferPrice() { return offerPrice; } 
> While the following mapping works as expected:
> <class name="Pipe" table="t_pipe"> 
>  ... 
>     <many-to-one name="offerPrice" 
>                  class="pipetracker.model.price.OfferPrice" 
>                  formula="( select v_pipe_offerprice.offerprice_fk 
>                               from v_pipe_offerprice 
>                               where v_pipe_offerprice.id = id )"/> 
> ... 
> </class>
> This is not being treated as a formula because the generated SQL included a referece to the field pipe.offerprice_id which does not exsist because this is a virtual column calculated from a view. 

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