Hi guys
I have a table where i store counters of specific entity per each day (which acts as partition), with compound id of entity id and creation date.
When an entity is loaded it's matching counters should be loaded to, but i don't want to have a list of counters but rather one number with summarized counters value.
Is there a way to calculate this values with function or an <sql-query> ?
Code:
<class name="Entity" table="ENTITY">
<!-- should hold one counter object with summarized values-->
</class>
<class name="Counter" table="COUNTER">
<composite-id name="id" class="compositeId" >
<key-property name="id" column="ID" type="string"/>
<key-property name="creationDate" column="CREATION_DATE" type="timestamp"/>
</composite-id>
<property name="infoCounter" column="INFO_CNTR"/>
<property name="errorCounter" column="INFO_CNTR"/>
...
</class>
thanks