Skip to content

Selecting values into embedded dtos

gert-wijns edited this page Sep 13, 2014 · 2 revisions

When a dto contains a subdto, the values of the subdto can be set by getting it from the main dto and setting the values. Nested dto decoration doesn't need any setup.

Product product = query.from(Product.class);

Product productDto = query.select(Product.class);
productDto.setName(product.getName());
productDto.getProperties().getPlanning().
    setAlgorithm(product.getName());

=> "select hobj1.name as name, 
           hobj1.name as properties_planning_algorithm 
    from Product hobj1"
Clone this wiki locally