Wird der UNION durch Hibernate unterstützt?

moujtahid1977

Grünschnabel
Hallo,
ich benutze Hibernate und Spring und bin dabei eine Abfrage in HQL zu basteln, wobei ich eine union benutzen muss, anscheinend wird der union teil gar ausgeführt, meine Frage ist wird union überhaupt in Hibernate unterstützt, wenn nicht welche Möglichkeit habe ich stattdessen(union).meine HQL Abfrage wird gebraucht um bestimmte Daten aus einer Tabelle(einzige) auszulesen:
ich habe die Abfrage so formuliert:
Code:
String query = new StringBuilder("from Configuration c where ")
        .append(" 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 ")
        .append(" 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 ")
        .append(" where c.application = :globalInstance")
        .append(" and c.user = :user")
        .append(" and c.key like :key and c.key not in (select c.key from c "
                        + " where c.application = :application ")
        .append(" and c.user = :user")
        .append( " or c.application  = :application and c.user = :userAll)").toString();

Hat jemand Ahnung,was da nicht in Ordnung? Danke schon mal für die Antwort.
 

Neue Beiträge

Zurück