In Hibernate I can use very useful readonly "derived" properties:
<property name="totalPrice" formula="( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product p WHERE li.productId = p.productId AND li.customerId = customerId AND li.orderNumber = orderNumber )"/>
no, I'll support it as a hibernate specific extension