We help IT Professionals succeed at work.

Spring - hibernate full flow

royjayd
royjayd asked
on
hi guys
I have been struts developer for last few years and now switching to spring.
In struts we had the following flow
jsp--> action form--> action class--> business delegate--> session facade--> ejb-->dao-->db

I have read few articles on spring and hibernate but i want the full flow from front end to back end while developing project in spring and hibernate.
I came up with this
jsp --> spring config file -->DAO  , is that it? or am i missing something?

if anyone can explain the full flow in spring and hibernate, i will greatly apreciate
thanks

Comment
Watch Question

JSP-----> SpringConfigFlie ---------->Controller -----> after that depend upon ur project Architecture
as per ur old (Struts) project  
jsp--> SpringConfigFlie --> Controller class--> business delegate->dao-->HBM(hibernate config Flie throug POJO) -->DB
 
if u need validatior means ! flow will come like this
 
jsp--> SpringConfigFlie --> Validatior calss ---->Controller class-->  and so on .....

Author

Commented:
ok thanks. Is it possible for me to use plain sql and not hibernate query language? or is it mandatory to use the hibernate query language in spring-hibernate aplications.

ya u can use like create sessionFactory
session.createSQLQuery()
but better u can go for HQL query bcz thats is directly mention ur POJO class name
which IDE ur using ?
 
create sessionFactory object

Author

Commented:
i am using eclipse. the thing is i dont want to depend on HQL since its propritery, tomorrow HQL can be replaced by something else, so I want to stick with sql. what is your opinion?

is there a project  (anywhere online) which shows a complete spring - hibernate application ?


thanks.
you can use ...
but manul close all connection if u use native query means
 
if u use HQL mean then it  will automatically close ur connection ,open ur coneection flush kind of things ....
 
native query means u will do manully
u need sample code or porject  ??

Author

Commented:
yeah , a sample project (slightly complicated) which uses spring and hibernate will be great. thanks