I have problem with updating data...
My goal: I need to generate statistics of offer's display count. When offer is displaying I want to update offer's stat from from current date, of current type.
When I invoke getHibernateTemplate().saveOrUpdateMethod() after updating object property, nothink happens - value in database is not changed - I don't get any exceptions.
My Hibernate version: 3.2.2
Stats are saved in OfferStat table. It's hbm.xml is:
<class
name="com.eastcom.rnw.entities.OfferStat"
table="offer_stat"
schema="public"
>
<cache
usage="read-write"
/>
<id
name="offerStatId"
type="long"
column="offer_stat_id"
length="4"
>
<generator class="identity" />
</id>
<property
name="statDate"
type="date"
column="stat_date"
length="4"
/>
<property
name="visitCount"
type="integer"
column="visit_count"
length="4"
/>
OfferStatDAO:
public void persistOfferStat(OfferStat offerStat)
{
getHibernateTemplate().saveOrUpdate(offerStat);
}
In serivce first I'm getting offer stat form particulary date, of particulary type, than I change visitCOunt of this offer and invoke persistOfferStat(OfferStat offerStat) from DAO.
Any clues?
Thanks for any help
|