本文整理匯總了Java中javax.persistence.criteria.JoinType.LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java JoinType.LEFT屬性的具體用法?Java JoinType.LEFT怎麽用?Java JoinType.LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.persistence.criteria.JoinType
的用法示例。
在下文中一共展示了JoinType.LEFT屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: performsTwoFetches
@Test
public void performsTwoFetches() {
JoinFetch<Customer> spec1 = new JoinFetch<Customer>(new String[] { "orders" }, JoinType.LEFT);
JoinFetch<Customer> spec2 = new JoinFetch<Customer>(new String[] { "orders2" }, JoinType.INNER);
Conjunction<Customer> spec = new Conjunction<Customer>(spec1, spec2);
List<Customer> customers = customerRepo.findAll(spec);
assertThat(customers).isNotEmpty();
for (Customer customer : customers) {
assertTrue(Hibernate.isInitialized(customer.getOrders()));
assertTrue(Hibernate.isInitialized(customer.getOrders2()));
}
}
示例2: testMethod_joinContainerWithRegularJoin
public void testMethod_joinContainerWithRegularJoin(
@Joins({
@Join(path = "join1", alias = "alias1", type = JoinType.INNER, distinct = true),
@Join(path = "join2", alias = "alias2", type = JoinType.LEFT, distinct = false)
})
@Spec(path = "path1", spec = Like.class) Specification<Object> spec) {
}
開發者ID:tkaczmarzyk,項目名稱:specification-arg-resolver,代碼行數:7,代碼來源:SpecificationArgumentResolverTest.java
示例3: testMethod_joinContainerWithRegularAndFetchJoins
public void testMethod_joinContainerWithRegularAndFetchJoins(
@Joins(value = {
@Join(path = "join1", alias = "alias1", type = JoinType.INNER, distinct = true),
@Join(path = "join2", alias = "alias2", type = JoinType.LEFT, distinct = false)
}, fetch = {
@JoinFetch(paths = { "fetch1" }),
@JoinFetch(paths = { "fetch2" }, joinType = JoinType.INNER)
})
@Spec(path = "path1", spec = Like.class) Specification<Object> spec) {
}
開發者ID:tkaczmarzyk,項目名稱:specification-arg-resolver,代碼行數:10,代碼來源:SpecificationArgumentResolverTest.java
示例4: fetchesLazyCollection
@Test
public void fetchesLazyCollection() {
JoinFetch<Customer> spec = new JoinFetch<Customer>(new String[] { "orders" }, JoinType.LEFT);
List<Customer> customers = customerRepo.findAll(spec);
assertThat(customers).isNotEmpty();
for (Customer customer : customers) {
assertTrue(Hibernate.isInitialized(customer.getOrders()));
}
}
示例5: leftJoin
public <K> JoinBuilder<E, K> leftJoin(final SingularAttribute<? super E, K> attribute)
{
return new JoinBuilder<>(attribute, JoinType.LEFT, false);
}