[rules-users] How to Configure Hibernate and use in Drools

Marcus Ilgner marcus.ilgner at gmail.com
Tue Jun 3 02:59:26 EDT 2008


Hi Sekhar,

On Mon, Jun 2, 2008 at 5:56 PM, RAJA SEKHAR REDDY MAYALURU
<rajasekharreddym at gmail.com> wrote:
> hi ,
>
> i need to connect to data from a .drl file from a rule . i need to get the
> dynamic data from DB to frmae a rule .
>
> I have seen that Drools support  Hibernate .
>
> so how can i connect to DB from a drl to  DB using hibernate .
>
> i need to have dynamic (data ) rules in my drl file .
>
> we can configure hibernate on top of pojo , my main intrest is to know how
> to invoke hibernate from a drl file .
>
> how to execute named queries  in the rule project .
>
> please send me the steps to configure hibernate and use it in rules project
.
while you cannot directly access your ORM in Drools, it's nonetheless
quite simple: just write some DAO which provides methods to access
your objects - you could, for example, simply have a method which
takes the name of a NamedQuery and executes it - and register it as a
global. Then you can use the "from" syntax to retrieve the objects in
your rules.

Best regards
Marcus



More information about the rules-users mailing list