java.lang.IllegalArgumentException: alias not found: serverIP

Hibernate JIRA | Tamir Solomon | 9 years ago
  1. 0

    On Oracle you can do this: SELECT object.ID FROM TABLE object FOR UPDATE OF object.ID giving you back the id and locking lines. But with Hibernate it's not working. Query q = session.createQuery("SELECT object.ID FROM TABLE object"); q.setLockMode("object",LockMode.UPGRADE); q.list(); This code generate the following error: Exception in thread "Thread-0" java.lang.IllegalArgumentException: alias not found: obj 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:1552) 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:2145) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) at org.hibernate.loader.Loader.list(Loader.java:2024) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) What's working actually : Query q = session.createQuery("SELECT object FROM TABLE object"); q.setLockMode("object",LockMode.UPGRADE); q.list();

    Hibernate JIRA | 1 decade ago | vision matford
    java.lang.IllegalArgumentException: alias not found: obj
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Hi, I am getting exception when executing following code: {code} @Entity @FilterDef(name="personIsActiveFilter", defaultCondition="active = 1") public class Person { @Id Long id; String name; boolean active; } ... session.enableFilter("personIsActiveFilter"); session.createQuery("from Person p where p.name = ':abc'").list(); {code} Stack trace is the following: {code} java.lang.IllegalArgumentException: Invalid filter-parameter name format at org.hibernate.engine.LoadQueryInfluencers.parseFilterParameterName(LoadQueryInfluencers.java:162) at org.hibernate.engine.QueryParameters.processFilters(QueryParameters.java:485) at org.hibernate.engine.QueryParameters.processFilters(QueryParameters.java:458) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1669) at org.hibernate.loader.Loader.doQuery(Loader.java:801) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.doList(Loader.java:2533) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) {code} I can´t use named query parameter because whole where clause is built in another part of application.

    Hibernate JIRA | 6 years ago | Tomas Hradec
    java.lang.IllegalArgumentException: Invalid filter-parameter name format
  4. 0

    Hi, I am getting exception when executing following code: {code} @Entity @FilterDef(name="personIsActiveFilter", defaultCondition="active = 1") public class Person { @Id Long id; String name; boolean active; } ... session.enableFilter("personIsActiveFilter"); session.createQuery("from Person p where p.name = ':abc'").list(); {code} Stack trace is the following: {code} java.lang.IllegalArgumentException: Invalid filter-parameter name format at org.hibernate.engine.LoadQueryInfluencers.parseFilterParameterName(LoadQueryInfluencers.java:162) at org.hibernate.engine.QueryParameters.processFilters(QueryParameters.java:485) at org.hibernate.engine.QueryParameters.processFilters(QueryParameters.java:458) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1669) at org.hibernate.loader.Loader.doQuery(Loader.java:801) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.doList(Loader.java:2533) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) {code} I can´t use named query parameter because whole where clause is built in another part of application.

    Hibernate JIRA | 6 years ago | Tomas Hradec
    java.lang.IllegalArgumentException: Invalid filter-parameter name format

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      alias not found: serverIP

      at org.hibernate.loader.hql.QueryLoader.applyLocks()
    2. Hibernate
      QueryLoader.list
      1. org.hibernate.loader.hql.QueryLoader.applyLocks(QueryLoader.java:299)
      2. org.hibernate.loader.Loader.preprocessSQL(Loader.java:189)
      3. org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1529)
      4. org.hibernate.loader.Loader.doQuery(Loader.java:661)
      5. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
      6. org.hibernate.loader.Loader.doList(Loader.java:2211)
      7. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
      8. org.hibernate.loader.Loader.list(Loader.java:2090)
      9. org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
      9 frames
    3. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.list
      1. org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
      1 frame
    4. Hibernate
      QueryImpl.list
      1. org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
      2. org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
      3. org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      3 frames