public static PurchaseOrder[] getPurchaseOrders() { PurchaseOrder[] pos = new PurchaseOrder[0]; List<com.uslc.pe.jpa.entity.PurchaseOrder> list = PurchaseOrderRepo.findAll(); if (list != null) { pos = new PurchaseOrder[list.size()]; for (int i = 0; i < list.size(); i++) { pos[i] = new PurchaseOrder(list.get(i)); } } return pos; }