Hi!
I'm writing an HQL query like this
Code:
from SomeObject as a
where a.someProperty = :someProperty
AND a.someProperty2 = :someProperty2
and I set the parameters doing
Code:
query.setProperties(param)
where the "param" object is of type SomeObject, and has the method getSomeProperty:
hibernate bind the named parameters in the query with the property of the object
I pass throug setProperties()...
Everything works, ok.
Now the question: is it another method to pass an arbitrary number of parameters
(with arbitrary names) to the query??
I mean, I don't want to pass an object of the type SomeObject, but - I guess - a
Map with some entries, which has the keys "someProperty" and "someProperty2"...
It seems not to work!
(I ask this because my SomeObject has some fields that are objects with their own fields,
i.e.: if SomeObject.someProperty is an object with two properties, prop1 and prop2,
and I want to write a "where" condition like
Code:
where a.someProperty.prop1 = :someProperty.prop1
I mean, using only a subset of all the properties mapped for the someProperty
object..
)
thank you everybody for helps and suggestions!!
A.