query of attributes that are Collections of Values and arrays fail

Description

The following query to return the attribute "address" that is a collection or an array throws an exception.

select r.Id, r.address from Foo r where r.Id in (:ids) order by r.Id

org.hibernate.QueryException: not an entity [select r.Id, r.address from com.cisco.nm.model.enum.Foo r where r.Id in (:ids) order by r.Id]
at org.hibernate.hql.ast.tree.FromElementType.renderIdentifierSelect(FromElementType.java:143)
at org.hibernate.hql.ast.tree.FromElement.renderIdentifierSelect(FromElement.java:167)
at org.hibernate.hql.ast.tree.SelectClause.renderNonScalarIdentifiers(SelectClause.java:398)

thanks,
jaideep

Environment

oracle 10g

Activity

Show:
Steve Ebersole
November 21, 2006, 11:40 PM

You just want a better error message? What you are trying is not valid syntax. I think what you want is:
select r.Id, elements( r.address ) from Foo r where r.Id in (:ids) order by r.Id

Well I think what you really want is to get back a list of [id, array] pairs which is totally not supported...

Jaideep Vasudevan
November 22, 2006, 1:29 AM

Hi Steve,

I wanted to know how to query a collection.

Hibernate support team said there is no option and asked me to ask for this enhancement.

you can close this. thanks.

– jaideep

Brett Meyer
October 8, 2013, 3:52 PM

Based on comments, closing.

Rejected

Assignee

Unassigned

Reporter

Jaideep Vasudevan

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure