Skip to Content
0
Former Member
Jun 12, 2018 at 12:00 PM

Convert List of Model into a DTO

632 Views

Hello Guys,

I have a question by implementing a DataLayer Object. I try to convert a List of OrderModels into a DataLayer Object, but I have no idea how to handle it.

I tried to implement a Populator, DataLayerData> but I can't use the Converts.convertAll() methode in my Facade, because it returns List. Is there a possibility of converting a List of Objects into a single Object with Hybris, or should I implement my own Populator which will do this job like

 public DataLayerData getDataLayerData(final List<OrderModel> source) {
 // do your job
 }

Thanks for help so far!