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