Hello, I have a little problem. I use Spring and Hibernate. When I try to set a property, Hibernate try to SELECT from database. But it's no good becouse I can't set property without open session. For example:
Hibernate version:3.3.1
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="ru.gubber.partnership.model.SystemProperties" table="SYSTEM_PROPERTIES">
<id name="propIdent" column="PROPERTY_IDENT">
<generator class="assigned"/>
</id>
<property name="propValue" column="PROPERTY_VALUE" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
logger.debug("1");
SystemProperties props = (SystemProperties) session.load(SystemProperties.class, propIdent);
logger.debug("2");
if (props == null) props = new SystemProperties(propIdent);
logger.debug("3");
props.setPropValue(propValue);
logger.debug("4");
session.saveOrUpdate(propValue);
logger.debug("5");
logtrace:14:46:45,375 DEBUG ru.gubber.partnership.dao.PropertiesDAO :36 - 1
14:46:45,375 DEBUG ru.gubber.partnership.dao.PropertiesDAO :38 - 2
14:46:45,375 DEBUG ru.gubber.partnership.dao.PropertiesDAO :40 - 3
Hibernate: select systemprop0_.PROPERTY_IDENT as PROPERTY1_14_0_, systemprop0_.PROPERTY_VALUE as PROPERTY2_14_0_ from SYSTEM_PROPERTIES systemprop0_ where systemprop0_.PROPERTY_IDENT=?
[/code]
What should I do to disable auto-load?