[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2735?page=c...
]
Christian Beikov commented on HHH-2735:
---------------------------------------
Within a system that keeps track of versions of the data it would be really nice if this
would work
expected to work: s.createQuery("select max(e.verison)+1 from entity e where
id=?").setInteger(1,1).setLockMode("e", LockMode.UPGRADE).uniqueResult();
if there is any other solution than iterating over all versions and check that stuff in
memory then give me a hint please.
Query . setLockMode cannot find the alias when the query defines a
select clause
--------------------------------------------------------------------------------
Key: HHH-2735
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2735
Project: Hibernate Core
Issue Type: Bug
Reporter: Tamir Solomon
I tried to perform the following :
Query q1 = session.createQuery("select serverIP.server from ServerIP serverIP where
serverIP.ip = :ipStr");
q1.setLockMode("serverIP",LockMode.NONE);
q1.setParameter("ipStr", ip);
q1.list();
and i get this error :
Frame : java.lang.IllegalArgumentException: alias not found: serverIP
at org.hibernate.loader.hql.QueryLoader.applyLocks(QueryLoader.java:299)
at org.hibernate.loader.Loader.preprocessSQL(Loader.java:189)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1529)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira