Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread VANKEISBELCK Remi
Hi,

Unfortunately there ain't no official Stripes/Hibernate plugin as far as
I know. We had Stripernate once but it doesn't seem to exist any more. We
discussed this on IRC recently and agreed it's a problem, the lack of such
integration layers...

We're typically in the case of someone who wants to persist data (everybody
or almost does) and we have no real answer for him. It's doable and many of
us rolled their own solution, but it's not available directly, as a plugin,
whereas it totally could (Stripernate).

Anyway, here's how it goes :
1/ setup the SessionFactory at init time (webapp listener or
load-on-startup servlet), configure the entity classes etc
2/ register Type Converter(s) and Formatters for Entity classes : those
will convert incoming HTTP params to Entity objects (we often refer to this
as hydratation of the Domain Objects)
3/ manage transactions (per request - OSIV, per DAO call, ...)
4/ integrate Validator to ValidationMetadataProvider

I think integrating another ORM would be pretty much similar.

1,2 and 3 are pretty easy to handle. 4 is another story.

Here's some code (from Woko http://woko.pojosontheweb.com) if you want to
have a look :

1/
https://github.com/pojosontheweb/woko/blob/develop/hibernate/src/main/java/woko/hibernate/HibernateStore.java
(implementation of the persistence layer built on hibernate)

2/
https://github.com/pojosontheweb/woko/blob/develop/core/src/main/java/woko/actions/WokoTypeConverter.java
and
https://github.com/pojosontheweb/woko/blob/develop/core/src/main/java/woko/actions/WokoFormatter.java

and their factories : those use the ObjectStore in 1/ in order to do the
job.

3/
https://github.com/pojosontheweb/woko/blob/develop/core/src/main/java/woko/actions/WokoTxInterceptor.java
(OSIV style, implemented as a Stripes Interceptor)

4/
https://github.com/pojosontheweb/woko/blob/develop/core/src/main/java/woko/actions/nestedvalidation/NestedValidationMetadataProvider.java


Again, this code is clearly not something you should need to worry about,
it is quite specific Stripes/Hb gluecode.

So I'd start with a built-in stack if I were you, be it Woko or another,
but with one single requirement : your UI code (ie controllers and views)
should not depend on the framework. If it's done correctly, persistence is
non-intrusive, and you should be able to replace the whole thing without
impacting the whole app. The code that depends on Hb is the Type Converters
and stuff, but again, this is transparent.

With Woko, and probably the other folks' frameworks too, you just write
annotated entities and have all the rest working directly (1,2,3, and 4).
Then you can write your ActionBeans and JSPs, with a persistence layer that
works ootb. You don't have to use *all* of those stacks, and they can serve
as a bootstrap for writing applicative code directly instead of plumbing.

You can even remove the dep on the fwk eventually, and implement the
persistence layer differently.

Cheers

Rémi


2015-08-21 2:27 GMT+02:00 parveen yadav parveenyadavtit...@gmail.com:

 Hi All,

 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not
 have
 experience with any other frameworks at all. I am unable to find any step
 by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced
 programmer.

 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with
 Stripes

 thanks
 yadav



 --
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread Rick Grashel
Yadav,

Something you should look at is implementing an Generic AbstractDAO
pattern.  In Java, this is a wonderful way to separate things at the domain
object level and allow for a high amount of re-use.  If you are using
Spring (which most Hibernate users are), take a look at this page:

http://www.codeproject.com/Articles/251166/The-Generic-DAO-pattern-in-Java-with-Spring-3-and

Once you have created your DAOs, you will want to make get accessible from
your Stripes ActionBeans by injecting them into a custom ActionBeanContext
that you create for your application (by implementing the ActionBeanContext
interface and declaring it in your web.xml -- see here
https://stripesframework.atlassian.net/wiki/display/STRIPES/Configuration+Reference).
Then, in your Stripes ActionBean, you end up with code like this:

int numberOfCustomers = getContext().getCustomerDAO().countAll();

I have been wanting to create an example Stripes project which uses
Hibernate and a simple in-memory database as an example of how easy it is
to do a full-stack application in Stripes, but I just haven't had the time
lately.

If you are building a more Ajax-oriented application, then you will want to
look at the Rock and Roll example in the Stripes main branch:

https://github.com/StripesFramework/stripes/tree/master/examples/src/main/java/net/sourceforge/stripes/examples/rockandroll

As you build a small example, please feel free to reach out here or come to
IRC for help (#stripes).  We're here to help you get up and running.  We've
all built large applications using Stripes, so we have a lot of experience
in doing it.

Thanks!

-- Rick


On Thu, Aug 20, 2015 at 7:27 PM, parveen yadav parveenyadavtit...@gmail.com
 wrote:

 Hi All,

 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not
 have
 experience with any other frameworks at all. I am unable to find any step
 by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced
 programmer.

 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with
 Stripes

 thanks
 yadav



 --
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread Remi Vankeisbelck
Nice, I didn't know it was still available.

We should move the code to gh and add some docs in the wiki ?

Cheers

Rémi 

-Message d'origine-
De : Tom Coleman tcole...@autowares.com
Envoyé : ‎21/‎08/‎2015 19:58
À : Stripes Users List stripes-users@lists.sourceforge.net
Objet : Re: [Stripes-users] Integrate Hibernate or eBean with Stripes



Check out stripersist:


http://sourceforge.net/projects/stripes-stuff/files/Stripersist/


There is a sample program in the distribution.


It simple and works like a charm.


On Aug 20, 2015, at 8:27 PM, parveen yadav wrote:


Hi All,

This is my first interaction with Stripes. The framework looks clean and
simple. I come from Oracle Commerce(formally ATG) background and do not have
experience with any other frameworks at all. I am unable to find any step by
step guide to integrate Hibernate or EBean with stripes. The documentation
(only for Hibernate) provided on the site is more for a experienced programmer.

I am developing a portal related to real-estate. It will be really helpful
if someone could help me out on integrating ebeans or hibernate with Stripes

thanks
yadav--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread Joaquin Valdez
Yes please.

Joaquin Valdez
joaquinfval...@gmail.com
1.541.702.1281

 On Aug 21, 2015, at 2:30 PM, Remi Vankeisbelck r...@rvkb.com wrote:
 
 Nice, I didn't know it was still available.
 
 We should move the code to gh and add some docs in the wiki ?
 
 Cheers
 
 Rémi
 De : Tom Coleman mailto:tcole...@autowares.com
 Envoyé : ‎21/‎08/‎2015 19:58
 À : Stripes Users List mailto:stripes-users@lists.sourceforge.net
 Objet : Re: [Stripes-users] Integrate Hibernate or eBean with Stripes
 
 
 Check out stripersist:
 
 http://sourceforge.net/projects/stripes-stuff/files/Stripersist/ 
 http://sourceforge.net/projects/stripes-stuff/files/Stripersist/
 
 There is a sample program in the distribution.
 
 It simple and works like a charm.
 
 On Aug 20, 2015, at 8:27 PM, parveen yadav wrote:
 
 Hi All,
 
 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not have
 experience with any other frameworks at all. I am unable to find any step by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced 
 programmer.
 
 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with Stripes
 
 thanks
 yadav
 
 
 --
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread Nestor Hernandez
Hi Yadav, Are you sure that you want to use the Hibernate API?, We have an
standard API for ORM that is called JPA and works with multiple
providers(Hibernate, EclipseLink, etc.)

If you're deploying to a Java EE server (Full or WebProfile) then i'ts very
easy to use JPA, because it all comes integrated. There are many Java EE
servers like TomEE, Glassfish, WebLogic.

This page has a good example in order to use JPA with EJB in TomEE
https://jaxenter.com/getting-started-with-apache-tomee-105824.html. Usually
only the configuration of the database is different in servers, the API is
the same .

Once you have your Dao you can inject (@Inject) in an ActionBean. In order
to do that get this plugin
https://github.com/StripesFramework/stripes-injection-enricher

Cheers!









2015-08-21 12:58 GMT-05:00 Tom Coleman tcole...@autowares.com:


 Check out stripersist:

 http://sourceforge.net/projects/stripes-stuff/files/Stripersist/

 There is a sample program in the distribution.

 It simple and works like a charm.

 On Aug 20, 2015, at 8:27 PM, parveen yadav wrote:

 Hi All,

 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not
 have
 experience with any other frameworks at all. I am unable to find any step
 by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced
 programmer.

 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with
 Stripes

 thanks
 yadav




 --

 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users


--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread Tom Coleman

Check out stripersist:

http://sourceforge.net/projects/stripes-stuff/files/Stripersist/

There is a sample program in the distribution.

It simple and works like a charm.

On Aug 20, 2015, at 8:27 PM, parveen yadav wrote:

 Hi All,
 
 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not have
 experience with any other frameworks at all. I am unable to find any step by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced 
 programmer.
 
 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with Stripes
 
 thanks
 yadav
 

--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread parveen yadav
parveen yadav parveenyadavtitian@... writes:

 
 Hi All,
 
 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not have
 experience with any other frameworks at all. I am unable to find any step by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced
programmer.
 
 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with Stripes
 
 thanks
 yadav
 
 --
 


Hi All,

Thanks a lot for the help. 
I have finally figured out how to integrate ebeans
with stripes. I am creating a repository on git 
and will share the code with you all after that.

Note: replying to my message as it kept giving me error that
lines contains more that 80 characters so replying here

Thanks a lot
yadav


--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread Morten Matras
You may choose not to go down the DAO route, I might be wrong, but it seems to 
force you to write too many classes and interfaces.




It is actually possible to create a simple system with the following elements:




1 HibernateFilter class ensuring that transactions are managed as they should 
and that sets up the whole database and manages all the Entities. Ensuring that 
the database is ready and updated with every update of the code.




1 java class per entity




1 line of code in each Stripes action function that tells the HibernateFilter 
whether to store updates on the entities in the database or not.




That way you end up with a few classes that manages the whole setup and 1 java 
bean per entity you need in your system.




No spring, just 1 simple 20 line hibernate.cfg.xml file and you are ready to 
add entity bean classes where you need them.




Stripes will manage the lookup from the database, the mapping of form elements 
with entity properties and the hibernatefilter will manage the process of 
persisting the entity.




Am I missing something?







Morten



—
Sent from Mailbox

On Fri, Aug 21, 2015 at 10:31 PM, Remi Vankeisbelck r...@rvkb.com wrote:

 Nice, I didn't know it was still available.
 We should move the code to gh and add some docs in the wiki ?
 Cheers
 Rémi 
 -Message d'origine-
 De : Tom Coleman tcole...@autowares.com
 Envoyé : ‎21/‎08/‎2015 19:58
 À : Stripes Users List stripes-users@lists.sourceforge.net
 Objet : Re: [Stripes-users] Integrate Hibernate or eBean with Stripes
 Check out stripersist:
 http://sourceforge.net/projects/stripes-stuff/files/Stripersist/
 There is a sample program in the distribution.
 It simple and works like a charm.
 On Aug 20, 2015, at 8:27 PM, parveen yadav wrote:
 Hi All,
 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not have
 experience with any other frameworks at all. I am unable to find any step by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced 
 programmer.
 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with Stripes
 thanks
 yadav--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread Alessio Stalla
Hi,

as another shameless plug, if you're interested in evaluating open source
frameworks based on Stripes and Hibernate that make CRUD dead simple and
require little or no programming, have a look at our Portofino:
http://portofino.manydesigns.com

cheers,
Alessio

On Fri, Aug 21, 2015 at 11:15 AM, parveen yadav 
parveenyadavtit...@gmail.com wrote:

 Morten Matras kodekongen@... writes:

 
 
  Hi Yadav
 
  Yes, integrating Hibernate with Stripes could be documented a bit better.
 Its been years since I looked at it.
 
  At LeadDoubler we've made a framework that does 95% of the programming
 for
 us related to hibernate. This might be what you are looking for.
 
  Are you looking for a simple how to tutorial?
 
 
  Morten Matras
 
  —Sent from Mailbox
 
 
  On Fri, Aug 21, 2015 at 2:31 AM, parveen yadav parveenyadavtitian at
 gmail.com wrote:
  Hi All,
  This is my first interaction with Stripes. The framework looks clean and
  simple. I come from Oracle Commerce(formally ATG) background and do not
 have
  experience with any other frameworks at all. I am unable to find any
 step by
  step guide to integrate Hibernate or EBean with stripes. The
 documentation
  (only for Hibernate) provided on the site is more for a experienced
 programmer.
  I am developing a portal related to real-estate. It will be really
 helpful
  if someone could help me out on integrating ebeans or hibernate with
 Stripes
  thanks
  yadav
 
 --
  ___
  Stripes-users mailing list
  stripes-users-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org
  https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
 
 
 
 
 --
 
 
  ___
  Stripes-users mailing list
  Stripes-users@...
  https://lists.sourceforge.net/lists/listinfo/stripes-users
 

 Hi Morten,

 My application is going to be pretty complex with time. So I looked at ORMs
 and Hibernate  EBean(First Choice) are the once I like the most. If you
 think your framework works well with stripes and can also provide almost
 the
 same functionality and is easy to use (like ebean) it will be great if you
 could share the framework  user
 guide.

 If not I am just looking for a simple tutorial that guides me in
 integrating
 ebean or hibernate with stripes and help me write a simple CRUD DAO

 Thanks
 yadav

 --
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users




-- 
*Alessio Stalla* | Software Architect
M: +39 340 7824743 | T: +39 010 566441 | F: +39 010 8900455
alessio.sta...@manydesigns.com | www.manydesigns.com

MANYDESIGNS s.r.l.
Via G. D'Annunzio, 2/51 | 16121 Genova (GE) | Italy
--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-21 Thread parveen yadav
Morten Matras kodekongen@... writes:

 
 
 Hi Yadav
 
 Yes, integrating Hibernate with Stripes could be documented a bit better.
Its been years since I looked at it.
 
 At LeadDoubler we've made a framework that does 95% of the programming for
us related to hibernate. This might be what you are looking for.
 
 Are you looking for a simple how to tutorial?
 
 
 Morten Matras
 
 —Sent from Mailbox
 
 
 On Fri, Aug 21, 2015 at 2:31 AM, parveen yadav parveenyadavtitian at
gmail.com wrote:
 Hi All,
 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not have
 experience with any other frameworks at all. I am unable to find any step by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced
programmer.
 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with Stripes
 thanks
 yadav
 --
 ___
 Stripes-users mailing list
 stripes-users-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
 
 
 
 --
 
 
 ___
 Stripes-users mailing list
 Stripes-users@...
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 

Hi Morten,

My application is going to be pretty complex with time. So I looked at ORMs
and Hibernate  EBean(First Choice) are the once I like the most. If you
think your framework works well with stripes and can also provide almost the
same functionality and is easy to use (like ebean) it will be great if you
could share the framework  user
guide. 

If not I am just looking for a simple tutorial that guides me in integrating
ebean or hibernate with stripes and help me write a simple CRUD DAO

Thanks
yadav
--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Integrate Hibernate or eBean with Stripes

2015-08-20 Thread Morten Matras
Hi Yadav




Yes, integrating Hibernate with Stripes could be documented a bit better. Its 
been years since I looked at it.




At LeadDoubler we've made a framework that does 95% of the programming for us 
related to hibernate. This might be what you are looking for.




Are you looking for a simple how to tutorial?







Morten Matras



—
Sent from Mailbox

On Fri, Aug 21, 2015 at 2:31 AM, parveen yadav
parveenyadavtit...@gmail.com wrote:

 Hi All,
 This is my first interaction with Stripes. The framework looks clean and
 simple. I come from Oracle Commerce(formally ATG) background and do not have
 experience with any other frameworks at all. I am unable to find any step by
 step guide to integrate Hibernate or EBean with stripes. The documentation
 (only for Hibernate) provided on the site is more for a experienced 
 programmer.
 I am developing a portal related to real-estate. It will be really helpful
 if someone could help me out on integrating ebeans or hibernate with Stripes
 thanks
 yadav
 --
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users--
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users