[hibernate-issues] [Hibernate-JIRA] Created: (ANN-762) @Columns cannot contain @Formula

Hontvári József (JIRA) noreply at atlassian.com
Mon Aug 11 09:37:09 EDT 2008


@Columns cannot contain @Formula
--------------------------------

                 Key: ANN-762
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-762
             Project: Hibernate Annotations
          Issue Type: Improvement
    Affects Versions: 3.3.0.ga
            Reporter: Hontvári József
            Priority: Minor


You can use formula for mapping a composite user type in xml. For example in XML:

<property name="price" type="PriceType">
  <column name="value" />
  <formula>'USD'</formula>
</property>

This is not possible with Hibernate Annotations, because the @Columns annotation only accept @Column elements. Something like this should work:
@Type(name="PriceType")
@Columns(columns= { 
  @Column(name="theValue")
  @Formula(value="USD")
})
Price price;

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