-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: could not resolve property
PostPosted: Mon Oct 30, 2006 4:53 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 3:37 am
Posts: 29
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 8:19 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 10:48 am
Posts: 30
Location: Rio de Janeiro, Brazil
try it

Code:
criteria.createAlias("actionType", "at")
criteria.add(Expression.eq("at.moduleId", 2));

_________________
Please don't forget to rateME!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 8:42 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 3:37 am
Posts: 29
it work many thx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 9:19 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 10:48 am
Posts: 30
Location: Rio de Janeiro, Brazil
If the answer did help you, please rate.

_________________
Please don't forget to rateME!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.