Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Jeanne Boyarsky
Ron McLeod
Tim Cooke
Sheriffs:
Devaka Cooray
paul wheaton
Mark Herschberg
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Frits Walraven
Jj Roberts
Bartenders:
Carey Brown
salvin francis
Piet Souris
Forum:
Object Relational Mapping
org.hibernate.hql.ast.QuerySyntaxException: Invalid path?
Philippe Desrosiers
Ranch Hand
Posts: 138
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm trying to determine the size of a relational set in HQL like so:
select ucp.channel from UserChannelPermission as ucp where ucp.user.login = :login and (ucp.canRead + ucp.canModify + ucp.canApprove + ucp.canRemove + ucp.canGrant >0) and ch.groups.size = 0
I'm gussing the syntax is wrong or something, because Hibernate is throwing this at me:
org.springframework.orm.hibernate3.HibernateQueryException: Invalid path: 'ch.groups.size' [select ucp.channel from com.foo.avp.model.UserChannelPermission as ucp where ucp.user.login = :login and (ucp.canRead + ucp.canModify + ucp.canApprove + ucp.canRemove + ucp.canGrant >0) and ch.groups.size = 0]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'ch.groups.size' [select ucp.channel from com.foo.avp.model.UserChannelPermission as ucp where ucp.user.login = :login and (ucp.canRead + ucp.canModify + ucp.canApprove + ucp.canRemove + ucp.canGrant >0) and ch.groups.size = 0] org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:657) org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) org.springframework.orm.hibernate3.HibernateTemplate.findByNamedParam(HibernateTemplate.java:947) com.foo.avp.dao.impl.ChannelDaoImpl.getOrphans(ChannelDaoImpl.java:41) com.foo.avp.view.filters.AdminSessionFilter.doFilter(AdminSessionFilter.java:156) com.foo.common.web.BaseFilter.doFilter(BaseFilter.java:44)
Can anyone tell me what I'm doing wrong?
Philippe Desrosiers
Ranch Hand
Posts: 138
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Holy crap I'm dumb. Nevermind.
Philippe Desrosiers
Ranch Hand
Posts: 138
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Well, dumb I may be, but it seems this issue has reared it's head again. I am once again receiving the "Invalid Path" exception, but this time the HQL looks good to me...
org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'r.enabled' [select distinct sc from com.foo.entities.RoutingRule rr inner join rr.shortcode sc where r.enabled = true and r.application is not null]
Any ideas? Am I doing something wrong here?
Philippe Desrosiers
Ranch Hand
Posts: 138
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
heheh. Once again. I'm dumb (in case there was any doubt). The RoutingRule alias was "rr", not "r".
Pays to re-read your code once in a while.
Rohit Mehta
Ranch Hand
Posts: 79
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
:-) very small thing - i encountered it as well ..
what was surprising that I was getting result even in case of exception ....
- Rohit
Grow a forest with seedballs and this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
hibernate3.3-spring3 project
String-Hibernate read-only mode (FlushMode.NEVER)
How to get aroun LazyInitialization exceptions using Spring HibernateDaoSupport?
hibernate3 save method exception
org.hibernate.MappingException: Unknown entity:
More...