I use @Formula.  It requires compile time instrumentation for lazy loading and 
will not load collections unless you use hibernate mapping files.  It works 
fine with calculated properties and annotations as shown below.

See:
http://opensource.atlassian.com/projects/hibernate/browse/ANN-210

It works well and you can even use the properties in HQL.

Example:
    private Double baseCostPerFt;
  |     @Basic(fetch = FetchType.LAZY)
  |     @Formula(value="( select v.basecostperft from v_item_calc v where v.id 
= id )")
  |     public Double getBaseCostPerFt() { return baseCostPerFt; }
  |     public void setBaseCostPerFt(Double baseCostPerFt) { this.baseCostPerFt 
= baseCostPerFt; }
  | 

HQL:
select i from Item i where i.baseCostPerFt>10.59


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109942#4109942

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109942
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to