what I am trying to do is delete the duplicates from a query result. I tried to use HashSet but did not quite work. So I am trying to delete the duplicates from the query directly.
This is the query
public List<SaleHeader> getSaleHeadersDevolutionsToSync(){
List<SaleHeader> saleHeaderList =new Select().from(SaleHeader.class)
.innerJoin(Devolution.class)
.on("Devolutions.idSaleHeader = SaleHeaders.idSaleHeader")
.where("Devolutions.idDevolution < 0").execute();
Log.e("Tag", String.valueOf(saleHeaderList));
return saleHeaderList;
}
This is the HashSet I tried
Set<SaleHeader> set = new HashSet<>(saleHeaderDevolutionList);
saleHeaderDevolutionList.clear();
saleHeaderDevolutionList.addAll(set);
Any help or sugestions on what to look for would be great, thanks
Finally I figure it out on how to implement a direct query