I'd like to use nested properties as my named parameters in my hql statements. For example,
Code:
select p from Person p where p.address.state.name = :address.state.name
Code:
Person p = new PersonImpl();
Address a = new AddressImpl();
State s = new StateImpl();
s.setName("PA");
a.setState(s);
p.setAddress(a);
query.setProperties(person);
I'm planning on subclassing Query to override setProperties and use BeanUtils in the implementation to handle the nested properties.
My problem is that "." is not allowed in the named parameter within the hql. There is an AST error.
I made a JIRA to allow "." in named parameters. It was reject with the statement, "use Query.setProperties". So I'm really missing something, because I don't understand how that can be used to allow me to use nested properties of the bean to set the named paramaters in the query.
[/code]