Hi,
I'm having a trouble while I'm trying to execute a criteria based query.
A property is not reconized (actionType.moduleId)
here is my query :
Code:
Criteria criteria = actionDbDAO.getCriteria();
criteria.add(Expression.eq("id.idMarket", marketId));
criteria.add(Expression.eq("actionType.moduleId", 2));
criteria.add(Expression.eq("isBlocked", false));
criteria.add(Expression.eq("isDeleted", false));
criteria.add(Expression.eq("settlement", 2));
criteria.add(Expression.eq("operationalMode", 2));
try {
List<ActionDb> dbEntities = criteria.list();
result = Action.convertFromDbEntites(dbEntities, messageService);
}catch (Exception ex) {
ec.handleError(ERR_GET_ENTITY, ex);
}
and in my ActionDb.hbm I've a the field actionType
Code:
<many-to-one name="actionType" class="com.mtsa.ebonus.core.db.action.ActionTypeDb" update="false" insert="false" fetch="select" lazy="false">
<column name="ID_MARKET" length="4" not-null="true" />
<column name="ID_ACTION_TYPE" length="3" not-null="true" />
</many-to-one>
and in my ActionTypeDb.hbm :
Code:
<property name="moduleId" type="integer">
<column name="REF_MODULE" />
</property>
thx for your advice