Problem mit Hibernate(Union)

moujtahid1977

Grünschnabel
Hallo,
Es scheint bei der Ausführung der Abfrage, als der Union Teil nichts ausgeführt bzw funktioniert, wie ich mir erwarte.Kann jemand mir sagen, was hier falsch ist.
Das Ergebniss ist zwei Datensätze, sie muss aber sechs Datensätze enthalten!

Danke schon mal im voraus!
Code:
from Configuration c where "
				+ " c.application = :globalInstance ")
				.append(" and c.user = :userAll")
				.append(" and c.key like :key and c.key not in  ")
				.append(
						" (select c.key from Configuration c where "
								+ " c.application = :application and c.user = :user")
				.append(
						" or c.application = :globalInstance and c.user = :user")
				.append(
						" or c.application  = :application and c.user = :userAll)")
.append(
						"union from Configuration c where c.application = : application and c.user = :user")
				.append(" and c.key like :key ").toString();
 
Zurück