java oracle hibernate


what is wrong with this method?

public void cleanLog(final Calendar from, final Calendar to)
    {
        getDao().getHibernateTemplate().execute(new HibernateCallback()
        {
            public Object doInHibernate(Session session) throws HibernateException
            {
                String hqlDeleteLog = "update EW_sub_TRANSACTION set EW_SUB_TRANSACTION.TRANSACTION_DETAILS = empty_clob() where ew_sub_transaction.EW_TRANSACTION_ID in ( select ew_transaction.EW_TRANSACTION_ID from ew_transaction where ew_transaction.TRANSACTION_DATE between :fromDate and :toDate)";

                session.createQuery(hqlDeleteLog).setCalendar("fromDate", from).setCalendar(
                        "toDate", to).executeUpdate();

                return null;
            }
        }, true);
    }

query works fine while using it in oracle but in this method it is throwing exception. Moreover when I am writing just like
update EW_sub_TRANSACTION set EW_SUB_TRANSACTION.TRANSACTION_DETAILS = empty_clob()  it is working but not with the whole hqlDeleteLog.

I am getting an error like :


org.springframework.orm.hibernate3.HibernateQueryException: expecting EQ, found '.' near line 1, column 49 [update EW_sub_TRANSACTION set EW_SUB_TRANSACTION.TRANSACTION_DETAILS = empty_clob() where ew_sub_transaction.EW_TRANSACTION_ID in ( select ew_transaction.EW_TRANSACTION_ID from ew_transaction where ew_transaction.TRANSACTION_DATE between :fromDate and :toDate)]; nested exception is org.hibernate.hql.ast.QuerySyntaxError: expecting EQ, found '.' near line 1, column 49 [update EW_sub_TRANSACTION ...................
gdv82Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimYatesCommented:
is:

    String hqlDeleteLog = "update EW_sub_TRANSACTION set TRANSACTION_DETAILS = empty_clob() where EW_TRANSACTION_ID in ( select ew_transaction.EW_TRANSACTION_ID from ew_transaction where ew_transaction.TRANSACTION_DATE between :fromDate and :toDate)";


any better?
0
gdv82Author Commented:

no . this gives me error like:
EW_sub_TRANSACTION is not mapped.
ew_transaction is not mapped.
Invalid path: 'ew_transaction.EW_TRANSACTION_ID'
.............................
0
Giant2Commented:
See better the uppercase/lowercase.
EW_sub_TRANSACTION
EW_SUB_TRANSACTION
ew_sub_transaction

Hope this could help you.
Bye, Giant.
0
gdv82Author Commented:
I GOT THE SOLUTION. actually i wrote sql query table names and not the object names of xml so it was like sql query rather than hql. which was creating a prob.
thanks .
0
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.