I'm trying to formulate a condition like:
package com.sample
import org.hibernate.Session;
import com.sample.entity.TempEntity;
global java.util.List myGlobalList;
rule "Hello World"
        when
                $hibernateSession : Session();
                $tmp1 :TempEntity($bin1 :bin) from $hibernateSession.createQuery("from TempEntity").list()
                $tmp2 : TempEntity($bin2 : bin) from myGlobalList
                //eval($bin == ((TempEntity)(myGlobalList.get(0))).getBin())
                eval($bin1 == $bin2)
        then
                System.out.println("success");
end
I'm trying to find an Entity by bin from DB.
there is only one entity in the "myGlobalList". NO complie error but it shows the following:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate:
select
tempentity0_.bin as bin0_,
tempentity0_.bank_name as bank2_0_,
tempentity0_.bank_id as bank3_0_,
tempentity0_.card_name as card4_0_,
tempentity0_.card_length as card5_0_,
tempentity0_.card_type as card6_0_
from
bin tempentity0_
what should I do if i want this rule works?
<br><hr align="left" width="300">
View this message in context: <a href="http://www.nabble.com/Why-this-rule-did%27t-work--tp25218669p25218669.html">Why this rule did't work?</a><br>
Sent from the <a href="http://www.nabble.com/drools---user-f11823.html">drools - user mailing list archive</a> at Nabble.com.<br>