This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!

asli kilic

Greenhorn
+ Follow
since Sep 15, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by asli kilic

I get session but i have a new problem
when i run the query i take the exception above
what is my mistake?

"Caused by: org.hibernate.exception.SQLGrammarException: could not execute query"

In my DAO



part of applicationContext.xml (forum does not allow text contains url , i can not paste the header here)
hi Mark thank you for your answer
my sql query is
select max(P.notu)-1 from (select sum(ky.notu) as notu from Yorum ky group by ky.yorumPK.kitapSiraNo) P

actually, i wanted to get max of sums.

Could you give an example about how to inject the Session Factory into my DAO/Repository class via constructor please? I can't see any configuration about session factory in applicationContext.xml (configuration file of Spring)
[ September 15, 2008: Message edited by: asli kilic ]
Hi,

I'm using hibernate + spring
i have a query like "select * from (select..." but i saw that "select" is not supported after "from".
Then i decide to use native sql (createSQLQuery)

So i found some examples like
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session.createSQLQuery(sql.toString()).list();

Congifuration() above tries to find hibernate configuration file to get sessionfactory but i have not that file in spring, however i have applicationContext.xml for configuration.

How can i get the session to create SQL Query? Please help me...Thank you