2

Consider I have a DTO as follows

SampleChildDTO {
   private String field1;
   private String field2;
}

This DTO is represented inside another DTO

ParentDTO{
   private String parentID;
   *private SampleChildDTO child*;
}

I am using Criteria to generate queries to get data from Parent class and store data to ParentDTO object using Tranformers.aliasToBean().

But I wanted to use just one call to store the data for Child class which is mapped in Parent and this data should go to the object for SampleChildDTO inside ParentDTO. Is there any way to achieve this than writing a separate query?

evyavan
  • 35
  • 8
  • You need to map `PArentDTO` and `SampleChildDTO`. Have you done that? – Darshan Lila Dec 24 '14 at 07:16
  • Ideally we can Map.Follow the link ... http://stackoverflow.com/questions/19628759/java-hibernate-criteria-setresulttransformertransformers-aliastobeanstudentm – sitakant Dec 24 '14 at 07:31
  • @DarshanLila I have mapped the fields in Parent and Child entities. Did you mean that? – evyavan Dec 26 '14 at 03:53
  • 1
    @SK08... I have already mapped fields from an entity to that in dto using projections, but I want to know if it is possible to have a child dto's object in parentDto and have the fields in child filled using projections. – evyavan Dec 26 '14 at 03:56

0 Answers0