Hi,
I've managed to get all of my direct JDBC calls replaced except for one. =
I can't figure out how to write this particular query using the =
hibernate query language, so I'm not even sure it is possible. If it's =
not possible then I'll take the time to implement it, however I wanted =
to make sure first.
Below is an example of the resulting SQL that I want to create:
select foo.id, foo.name
from foo
where foo.id in
(
select foo_attr.id_foo
from foo_attr
where (foo_attr.id_attribute =3D 'attribute1' and foo_attr.strvalue =
=3D 'value1')=20
and id_foo in
(
select foo_attr.id_foo
from foo_attr
where (foo_attr.id_attribute =3D 'attribute2' and =
foo_attr.strvalue =3D 'value2')=20
)
)
Basically, there is a parent table ("foo" in my example above) and there =
is list of attributes for a particular foo object (called "foo_attr") in =
my example above. I want to find all Foo's where it have an attribute =
"attribute1" equal to "value1" and an attribute "attribute2" equal to =
"value2".
So, is this something I will have to implement (and if so, are there =
suggestions on the syntax of the query), or does this already exist?
Thanks,
Jon...
|