Access OFBiz Entity Engine Persistence Manager outside OFBiz.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Access OFBiz Entity Engine Persistence Manager outside OFBiz.

pradeepruhil85
Hi Users,

I have a question regarding the entity engine of OFBiz.
Currently I have an application in which I am using Hibernate as
Persistence Manager. For this I am using a configuration file
to set the Persistence Manager for my application.
Now instead of this I want to use the OFBiz entity engine persistence
Manager.
So can you tell me what are the things I need to change to use the entity
engine persistence manager.

Configuration File I am using to set Hibernate is :

<persistence-unit name="org.my.persistence.jpa">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>jdbc/processInstanceDS</jta-data-source>
    <class>org.my.persistence.session.SessionInfo</class>
    <class>org.my.persistence.processinstance.ProcessInstanceInfo</class>
 
<class>org.my.persistence.processinstance.ProcessInstanceEventInfo</class>
    <class>org.my.persistence.processinstance.WorkItemInfo</class>

    <properties>
      <property name="hibernate.dialect"
value="org.hibernate.dialect.H2Dialect"/>
      <property name="hibernate.max_fetch_depth" value="3"/>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="hibernate.transaction.manager_lookup_class"
 value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
    </properties>
  </persistence-unit>
</persistence>

Is it possible to use OFBiz entity engine outside OFBIz?
Also if I am deploying my application inside OFBiz , so then can I use
entity engine ?

Please help to clear my doubt.




Thanks & Regards

Pardeep Ruhil


______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Access OFBiz Entity Engine Persistence Manager outside OFBiz.

Ruth Hoffman-2
Hello Pardeep:

The IMHO the Entity Engine (EE) is one of the greatest kept secrets
about OFBiz. I have used it in the past for many applications outside of
the OFBiz ERP suite. I have also used it in applications where Hibernate
was also being used (but not in the same Servlets.) There are lots of
ways to do this - but the easiest and fastest way to get started is to
build your application within the OFBiz framework and access the
database. All the coding tools (Java, Groovy, Bean Shell, Simple Methods
etc. ) are already integrated and use the EE.
 
You don't need to change anything in your Hibernate configuration.
Instead, remove the configuration file(s);  don't put any  Hibernate
jars on your classpath and convert your applications to run within the
framework. Of course, if you are already making database calls, you will
need to use the EE query language and not SQL. No worries however, the
EE query language is much easier to use than embedded SQL.

Regards,
Ruth


[hidden email] wrote:

> Hi Users,
>
> I have a question regarding the entity engine of OFBiz.
> Currently I have an application in which I am using Hibernate as
> Persistence Manager. For this I am using a configuration file
> to set the Persistence Manager for my application.
> Now instead of this I want to use the OFBiz entity engine persistence
> Manager.
> So can you tell me what are the things I need to change to use the entity
> engine persistence manager.
>
> Configuration File I am using to set Hibernate is :
>
> <persistence-unit name="org.my.persistence.jpa">
>     <provider>org.hibernate.ejb.HibernatePersistence</provider>
>     <jta-data-source>jdbc/processInstanceDS</jta-data-source>
>     <class>org.my.persistence.session.SessionInfo</class>
>     <class>org.my.persistence.processinstance.ProcessInstanceInfo</class>
>  
> <class>org.my.persistence.processinstance.ProcessInstanceEventInfo</class>
>     <class>org.my.persistence.processinstance.WorkItemInfo</class>
>
>     <properties>
>       <property name="hibernate.dialect"
> value="org.hibernate.dialect.H2Dialect"/>
>       <property name="hibernate.max_fetch_depth" value="3"/>
>       <property name="hibernate.hbm2ddl.auto" value="update"/>
>       <property name="hibernate.show_sql" value="true"/>
>       <property name="hibernate.transaction.manager_lookup_class"
>  value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
>     </properties>
>   </persistence-unit>
> </persistence>
>
> Is it possible to use OFBiz entity engine outside OFBIz?
> Also if I am deploying my application inside OFBiz , so then can I use
> entity engine ?
>
> Please help to clear my doubt.
>
>
>
>
> Thanks & Regards
>
> Pardeep Ruhil
>
>
> ______________________________________________________________________
>  

Reply | Threaded
Open this post in threaded view
|

Re: Access OFBiz Entity Engine Persistence Manager outside OFBiz.

pradeepruhil85
In reply to this post by pradeepruhil85
Hi Ruth,
Thanks for your reply.
 Is their any document or example or any solution  available from which if
I will be able to use entity engine outside OFBiz.
 If its not their can you give me an idea of achieving it.
 I will be very thankful to you.
 
Thanks & Regards

Pardeep Ruhil


______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Access OFBiz Entity Engine Persistence Manager outside OFBiz.

Ruth Hoffman-2
Hi Pardeep:
I'm not suggesting using the EE outside of OFBiz. Rather, convert you
application to run inside the OFBiz framework. It would be much easier
to just disable all the OFBiz components you don't want to use and go
from there.
Regards,
Ruth

[hidden email] wrote:

> Hi Ruth,
> Thanks for your reply.
>  Is their any document or example or any solution  available from which if
> I will be able to use entity engine outside OFBiz.
>  If its not their can you give me an idea of achieving it.
>  I will be very thankful to you.
>  
> Thanks & Regards
>
> Pardeep Ruhil
>
>
> ______________________________________________________________________
>  
Reply | Threaded
Open this post in threaded view
|

Re: Access OFBiz Entity Engine Persistence Manager outside OFBiz.

Anil Patel-3
If you wish to use Ofbiz framework only for developing your  
application, read document at following link.

http://docs.ofbiz.org/display/~jacopoc/Quick+Start+Guide+1+-+Getting 
+and+Running+OFBiz+in+5+steps

Regards
Anil Patel

On Aug 20, 2009, at 9:18 PM, Ruth Hoffman wrote:

> Hi Pardeep:
> I'm not suggesting using the EE outside of OFBiz. Rather, convert  
> you application to run inside the OFBiz framework. It would be much  
> easier to just disable all the OFBiz components you don't want to  
> use and go from there.
> Regards,
> Ruth
>
> [hidden email] wrote:
>> Hi Ruth,
>> Thanks for your reply.
>> Is their any document or example or any solution  available from  
>> which if I will be able to use entity engine outside OFBiz.
>> If its not their can you give me an idea of achieving it.
>> I will be very thankful to you.
>> Thanks & Regards
>>
>> Pardeep Ruhil
>>
>>
>> ______________________________________________________________________
>>