日期:2014-05-20 浏览次数:20982 次
<class name="lxt.entity.Parameter" table="tb_parameter" catalog="transport">
<composite-id name="id" class="lxt.entity.ParameterId">
<key-property name="paramType" type="string">
<column name="PARAM_TYPE" length="50" />
</key-property>
<key-property name="paramKey" type="string">
<column name="PARAM_KEY" length="50" />
</key-property>
</composite-id>
.
.
.
public Object get(Class<?> clazz, Serializable id)
{
Object o = getHibernateTemplate().get(clazz, id);
if (o == null)
{
throw new ObjectRetrievalFailureException(clazz, id);
}
return o;
}
public TruckInfo loadTruckById(String truckId) {
return (TruckInfo) this.truckDao.get(TruckInfo.class, truckId);
}
this.parameterDao.get(Parameter.class, paramType);//Parameter.class里没有paramType这个属性
//ParameterId.class 这个类没有映射,hibernate找不到