use of test_support.entity.sales.Order in project jmix by jmix-framework.
the class OrderScreen method onBeforeShow.
@Subscribe
protected void onBeforeShow(BeforeShowEvent event) {
Order mergedOrder = dataContext.merge(order);
orderDc.setItem(mergedOrder);
}
use of test_support.entity.sales.Order in project jmix by jmix-framework.
the class MultiSelectListTestScreen method onInit.
@Subscribe
private void onInit(InitEvent event) {
Order order = metadata.create(Order.class);
orderDc.setItem(order);
List<OrderLine> orderLines = IntStream.range(0, 5).mapToObj(i -> metadata.create(OrderLine.class)).collect(Collectors.toList());
allOrderLinesDc.getMutableItems().addAll(orderLines);
OrderLine orderLine = metadata.create(OrderLine.class);
orderLineDc.setItem(orderLine);
List<Product> products = IntStream.range(0, 5).mapToObj(i -> metadata.create(Product.class)).collect(Collectors.toList());
allProductsDc.getMutableItems().addAll(products);
CatalogObject catalog = metadata.create(CatalogObject.class);
catalogDc.setItem(catalog);
}
use of test_support.entity.sales.Order in project jmix by jmix-framework.
the class NativeQueryTest method testNativeQueryWithDataManager.
@Test
@Disabled
public void testNativeQueryWithDataManager() {
// https://www.cuba-platform.ru/discuss/t/problema-s-podgruzkoj-obekta-po-view-dobavlennogo-v-toj-zhe-tranzakiczii/5123
// given:
Customer customer = dataManager.create(Customer.class);
customer.setName("c1");
Order order = dataManager.create(Order.class);
order.setNumber("c1");
order.setCustomer(customer);
dataManager.save(customer, order);
storeAwareLocator.getTransactionTemplate(Stores.MAIN).executeWithoutResult(tx -> {
EntityManager entityManager = storeAwareLocator.getEntityManager(Stores.MAIN);
entityManager.createNativeQuery("select id from SALES_ORDER where ID = ?1", Order.class).setParameter(1, order.getId()).getSingleResult();
Order reloadedOrder = dataManager.load(Order.class).id(order.getId()).fetchPlan(builder -> {
builder.add("number").add("customer", FetchPlan.LOCAL);
}).one();
assertEquals("c1", reloadedOrder.getNumber());
assertEquals(customer, reloadedOrder.getCustomer());
});
}
use of test_support.entity.sales.Order in project jmix by jmix-framework.
the class CalendarTestScreen method initDataContainer.
protected void initDataContainer() {
Order order = metadata.create(Order.class);
ordersDc.setItems(Collections.singletonList(order));
}
use of test_support.entity.sales.Order in project jmix by jmix-framework.
the class EditorScreenFacetTestScreen method provideEntity.
@Install(to = "editorScreenFacet", subject = "entityProvider")
public Order provideEntity() {
Order order = metadata.create(Order.class);
order.setNumber("Test order");
return order;
}
Aggregations