Hello we have to use JBoss 4.2.3 and its Hibernate version
unfortunately it appears that @NamedNativeQuery is not supported by this configuration.
I have to translate
Code:
SELECT SUM(ABR_RF_REST) FROM (SELECT DISTINCT (abr_fall_id), ABR_RF_REST FROM tbe_abr WHERE ABR_RF_REST > 0)
to jpql
the objects is
Code:
@javax.persistence.Entity
@javax.persistence.Table( name="tbe_abr" )
public class ErgebnisRueckAbrechnung
@javax.persistence.JoinColumn( name="abr_fall_id" )
@Index(name="inx_abr_fall_id")
private bla.dbaccess.domain.Fall fall = null;
@javax.persistence.Column( name="abr_rf_rest", nullable=true )
private java.lang.Double rueckforderungRest = null;
My problem is: I want a sum of all rueckforderungRest, but there may be multiple entries in the table tbe_adr with the same abr_fall_id and abr_rf_rest and I must add only one instance of these duplicates to the sum.
Thanks,
Hans