Test query entity with mapped by embedded
This commit is contained in:
parent
7dab08448f
commit
e10eaf3ef4
|
@ -6,6 +6,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.orm.test.embeddable;
|
package org.hibernate.orm.test.embeddable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.query.Query;
|
import org.hibernate.query.Query;
|
||||||
|
|
||||||
|
@ -81,6 +83,13 @@ public class MappedByEmbeddableTest extends BaseCoreFunctionalTestCase {
|
||||||
loadContaining( session, 1, 2 );
|
loadContaining( session, 1, 2 );
|
||||||
loadContaining( session, 3, 3 );
|
loadContaining( session, 3, 3 );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
inTransaction( session -> {
|
||||||
|
Query<Contained> query = session.createQuery( "select c from contained c", Contained.class );
|
||||||
|
|
||||||
|
List<Contained> containeds = query.list();
|
||||||
|
assertThat( containeds ).hasSize( 3 );
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveComposition(Session session, int id, String data) {
|
private void saveComposition(Session session, int id, String data) {
|
||||||
|
|
Loading…
Reference in New Issue