Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Scout And Hibernate
Scout And Hibernate [message #875671] Wed, 23 May 2012 06:51 Go to next message
Panos Bariamis is currently offline Panos BariamisFriend
Messages: 2
Registered: May 2012
Junior Member
Hi forum!

I would like to ask if it is a good idea to use hibernate with scout or use the SQL helper class provided by scout?

Has anyone use hibernate with scout before?

Is there a tutorial/example how it could be used?

Thanks,
Panos
Re: Scout And Hibernate [message #875676 is a reply to message #875671] Wed, 23 May 2012 07:03 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan MotschFriend
Messages: 154
Registered: March 2010
Senior Member
Using hibernate (or also eclipse link) is a good idea.

Scout itself is not bound to a certain persistence technology.

Scout offers convenience for those not choosing hibernate to being able to use database in an easy way. Therefore the scout sql service is considered as a convenience feature and not a mandatory feature.

Maybe one architectural hint: Use hibernate / jpa on the scout server side of your application, including services, lookup services etc.

But use the scout formdata form bean objects to communicate with the ui forms. That way you have a good separation between client/ui side and server side (ui layer vs. service layer).

[Updated on: Wed, 23 May 2012 07:04]

Report message to a moderator

Re: Scout And Hibernate [message #875681 is a reply to message #875676] Wed, 23 May 2012 07:09 Go to previous messageGo to next message
Panos Bariamis is currently offline Panos BariamisFriend
Messages: 2
Registered: May 2012
Junior Member
Thanks Ivan for your answer.

Is there a manual explain how i could setup hibernate in scout and how to use it?
Re: Scout And Hibernate [message #895612 is a reply to message #875681] Fri, 13 July 2012 19:26 Go to previous messageGo to next message
anirban c is currently offline anirban cFriend
Messages: 2
Registered: July 2012
Junior Member
Ivan,

I would be interested in hibernate support as well. If you have a few pointers where to start from ?
just started learning up on scout though

-anirban
Re: Scout And Hibernate [message #896110 is a reply to message #895612] Tue, 17 July 2012 09:42 Go to previous messageGo to next message
Eclipse UserFriend
I'm working on a Scout Hibernate example. Check https://github.com/ahoegger/scout-hibernate-demo. Requires a Eclipse for Scout Developers featured with eGit from the Juno repository.

Help needed in:

  • Wiki HowTo, description
  • Hibernate KnowHow to have a valid reference implementation


Let me know if your need write access to the github repository.

-andreas
Re: Scout And Hibernate [message #896254 is a reply to message #896110] Tue, 17 July 2012 18:01 Go to previous messageGo to next message
anirban c is currently offline anirban cFriend
Messages: 2
Registered: July 2012
Junior Member
thanks Andreas,

checking it out now and will give it a try with a ref impl with your example

-anirban
Re: Scout And Hibernate [message #1060884 is a reply to message #896254] Tue, 28 May 2013 20:21 Go to previous messageGo to next message
Henrique Meira is currently offline Henrique MeiraFriend
Messages: 13
Registered: November 2012
Junior Member
Hello anirban.

Do you found any documentation, manual or tutorial to explain how to use the https://github.com/ahoegger/scout-hibernate-demo ?

I'm interested to use Scout with Hibernate, but I don't know how to start.

regards,

henrique.
Re: Scout And Hibernate [message #1060987 is a reply to message #1060884] Wed, 29 May 2013 12:27 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Hi Henrique,

Can you describe precisely your needs?
What are your blocking points?
- Have already Hibernate know-how?
- Have you enough know-how?

In my company, our main product (big scout based application) is using hibernate. It is in production! it is working.

We have started to build know-how in these domains (OSGi and Hibernate is also a big deal) and we will be happy to share.

Documenting "Scout+Hibernate" is on the roadmap, but it takes time. We will be happy to help if we can.
Re: Scout And Hibernate [message #1061064 is a reply to message #1060987] Wed, 29 May 2013 17:49 Go to previous messageGo to next message
Henrique Meira is currently offline Henrique MeiraFriend
Messages: 13
Registered: November 2012
Junior Member
Quote:

Can you describe precisely your needs?


I'm designing a new software, medium sized, and will use the Scout. However, I would like to use a persistence layer with the database (JPA) instead of using SQL in the Java code (as learned on tutorial).

Analyzing the scout-hibernate-demo project, I understand that the Hibernate piece is an eclipse plugin (OSGi), but I don't know the procedure to perform this task (create a hibernate plugin).

So I thought if there was a manual about how the scout-hibernate-demo was created, I could understand how to integrate these two frameworks, Hibernate and Scout.


Quote:

What are your blocking points?
- Have already Hibernate know-how?
- Have you enough know-how?


Specifically on Hibernate I don't have in-depth know-how. My JPA knowledge was acquired with eclipse-link.

For right now I would like to understand how to integrate the these frameworks (Scout & Hibernate).

Quote:

In my company, our main product (big scout based application) is using hibernate. It is in production! it is working.

We have started to build know-how in these domains (OSGi and Hibernate is also a big deal) and we will be happy to share.

Documenting "Scout+Hibernate" is on the roadmap, but it takes time. We will be happy to help if we can.


Good to know that there is a real case using these technologies together.

Thank you for your attention. I'll be happy with any material on this topic.

I'll see the link to learn how to integrate OSGi and Hibernate.

regards,

henrique

[Updated on: Wed, 29 May 2013 20:43]

Report message to a moderator

Re: Scout And Hibernate [message #1061312 is a reply to message #1061064] Fri, 31 May 2013 07:40 Go to previous messageGo to next message
Rene Eigenheer is currently offline Rene EigenheerFriend
Messages: 109
Registered: July 2009
Senior Member
Henrique,

we had the same requirement, that we do not used the SQL mechanism as presented in the tutorials. In fact we use a classical multi tier backend (service layer, business layer, persistence layer). For each of the backend layers we have a "standard" Eclipse Java (Maven) project with the speciality that we add an OSGI manifest. This way we can use this backend functionality the same way as plugins.

For hibernate we build a wrapper project which makes out of the standard hibernate library a osgi bundle (see http://bndtools.org/ or the maven plugin org.apache.felix:maven-bundle-plugin). If you have experiences with EclipseLink it could be the easier way to use EclipseLink instead of Hibernate...this shouldn't change anything in the architecture).

We see the scout server part as part of the front-end and do not add any business logic or database access to it.

From the scout server we call the backend with a factory method BACKEND,getService() to have the same mechanism as Scout Client uses to call Scout Server SERVICES.getService(). The service calls the business layer and business layer calls the persistence layer (DAO) which accesses the database using Hibernate.

Furthermore we have a "model" project where we have defined all the domain model classes which are mapped to database tables. We try directly to use these model classes as DTO and use them across all layers - also in the scout client.

Hope his gives you some ideas.

Rene
Re: Scout And Hibernate [message #1061408 is a reply to message #1061312] Fri, 31 May 2013 13:51 Go to previous messageGo to next message
Henrique Meira is currently offline Henrique MeiraFriend
Messages: 13
Registered: November 2012
Junior Member
Thank you René.

I liked your concept.

But, how do you integrates the hibernate osgi bundled with the scout?

Do you add a dependency in plugin.xml under server package?
Re: Scout And Hibernate [message #1061423 is a reply to message #1061408] Fri, 31 May 2013 14:42 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
There is no Hibernate OSGi bundle at the moment. From what I understood the hibernate jars are not OSGi bundles (see HHH-7527). However you can add them in an OSGi bundle.

That what we do in org.hibernate4.lib.fragment. The idea of this fragment is that the dependency to hibernate might also be provided by your application server if you prefer.

The plugin org.hibernate4.osgi is about fixing Hibernate to run in an OSGi environment (From what I understood, you need to change some classloader stuff. See also this interview: JBoss Releases Hibernate 4.0, answer to the question "How important is OSGI for you? How close is Hibernate to full OSGI support?").


I hope this helps.

(do not hesitate to ask until you have understood. I do not have so much knowledge myself, but I can ask around).


Re: Scout And Hibernate [message #1061444 is a reply to message #1061408] Fri, 31 May 2013 16:05 Go to previous message
Rene Eigenheer is currently offline Rene EigenheerFriend
Messages: 109
Registered: July 2009
Senior Member
Henrique Meira wrote on Fri, 31 May 2013 09:51
Do you add a dependency in plugin.xml under server package?


in the plugin.xml of the scout server package I add only a dependency on my backend service bundle, as I do not want, that the scout server has a direct access to my DAO and to hibernate.

simplified:

Scout server plugin.xml
Bundle-Name: org.example.scout.myapp.server
Require-Bundle: org.example.myapp.service,org.example.myapp.model

Backend Service bundle
Bundle-Name: org.example.scout.myapp.service
Require-Bundle: org.example.myapp.business,org.example.myapp.model

Backend Business bundle
Bundle-Name: org.example.scout.myapp.business
Require-Bundle: org.example.myapp.persistence,org.example.myapp.model

Backend Persistence bundle
Bundle-Name: org.example.scout.myapp.peristence
Require-Bundle: org.example.myhibernate,org.example.myapp.model
Eclipse-RegisterBuddy: org.example.myhibernate

MyHibernate Bundle (osgi wrapper for hibernate library)
Bundle-Name: org.example.myhibernate
Bundle-ClassPath: jars/hibernatexxxx.jar ....
Export-Package: org.hibernate.xxxx ....
Eclipse-BuddyPolicy: registered





Previous Topic:Marketplace entries?
Next Topic:Creating a RAP renderer for a custom GUI element
Goto Forum:
  


Current Time: Fri Apr 19 08:40:46 GMT 2024

Powered by FUDForum. Page generated in 0.01720 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top