Hibernate (Java): Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 1: | Zeile 1: | ||
== Sub Query == | == Hibernate 2 == | ||
=== Sub Query === | |||
<pre> | <pre> | ||
Zeile 9: | Zeile 11: | ||
invoiceCriteria.add(Subqueries.propertyIn("voucherType", voucherCriteria)); | invoiceCriteria.add(Subqueries.propertyIn("voucherType", voucherCriteria)); | ||
</pre> | </pre> | ||
== Hibernate 5 == | |||
=== Links === | |||
[https://howtodoinjava.com/hibernate/hibernate-jpa-2-persistence-annotations-tutorial https://howtodoinjava.com/hibernate/hibernate-jpa-2-persistence-annotations-tutorial] | |||
Zurück zu [[Java#Frameworks|Java]] | Zurück zu [[Java#Frameworks|Java]] |
Version vom 29. Juli 2018, 10:02 Uhr
Hibernate 2
Sub Query
ExtendedDetachedCriteria voucherCriteria = ExtendedDetachedCriteria.forClass(DocumentParameters.class); voucherCriteria.setProjection(Projections.property("targetVoucherType")); voucherCriteria.add(Restrictions.eq("client", client)); ExtendedDetachedCriteria invoiceCriteria = ExtendedDetachedCriteria.forClass(IncomingInvoice.class); invoiceCriteria.add(Subqueries.propertyIn("voucherType", voucherCriteria));
Hibernate 5
Links
https://howtodoinjava.com/hibernate/hibernate-jpa-2-persistence-annotations-tutorial
Zurück zu Java