Cybernd wrote:
Hiho
Example: (pseudocode)
class A {String base};
class B extends A {String addon};
Mapped via joined-subclass
Following HQL works:
"select a, a.base, a.addon from A a"
My Problem is, that im not interested into receving all instances of A. I just want a distinct of base + addon.
So i tried something like that:
"select distinct a.base, a.addon from A a"
Hibernate throws no exception, so he thinks that he is able to handle my hql. But my database is not able to work with the resulting SQL, because hib generates faulty wheres (they refer to lacking table aliases).
Is it necessary to include "a" in my resultquery?
Hibernate version: 3.0.5
thx for your Feedback
Bernhard Neuhauser
What about "from B as b" ? That would give you an object, B, that has two strings "base" and "addon".