I have created a native sql query using the Oracle CONNECT BY clause. However, upon execution I see a SQLException stating Unexpected token: START. I tried tweaking the named query syntax but in vain.
The mapping file containing the named query is like this:
<return alias="anh" class="com.xyz.core.commons.rdm.hibernate.AccountNumberHistory"/>
start with NEW_ACCT_NUM = :accountNumber
CONNECT BY PRIOR OLD_ACCT_NUM = NEW_ACCT_NUM
And I call it like this (using Spring):
List<AccountNumberHistory> accountHistories = this.getHibernateTemplate().findByNamedQueryAndNamedParam(
"AccountNumberHistory.findByAccountNumber", "accountNumber", accountNumber);
I am using Hibernate 3.2 version.
Any inputs will be highly appreciated!
posted 11 years ago
Nevermind..it does work with no extra tweaking
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!