Although I saw lots of questions related to my problem I couldn't get an appropriate answer.
I have a .xml file as following;
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Feb 7, 2007 10:55:48 AM by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping default-lazy="true" package="com.myworks.db.bean">
<class name="offerStocks" table="STOCKS" >
.
.
.
<property name="codes" type="java.math.BigDecimal">
<column name="STOCK_CODE" precision="14" not-null="true" />
</property>
<property name="stockName" type="string" formula="(SELECT STOK_NAMES FROM DESCRIPT S WHERE S.ID)STOCK_CODE)"/>
</class>
</hibernate-mapping>
When I call a record from offerStocks I get the related stockName too.
By adding a record (.saveOrUpdate()) I see that it is updated to the database.After I call it again I see that the stockName=null.After refreshing the page, then I see the appropriate value of stockName.
Is it possible to clean the cache after saveOrUpdate()?
If its neccessary I can post the whole source code!
|