Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
476 B
1
Indexable
Never
    public List<Inventory> Search(String name) throws Exception{
        if (CategoryRepo.findByCategoryname(name) != null) {
            int temp = category.getCategoryId();
            return (List<Inventory>) InventoryRepo.findBycategoryId(temp);
        }
        else if (InventoryRepo.findByProductname(name) != null){
            return (List<Inventory>) InventoryRepo.findByProductname(name);
        }
        throw new Exception(" Product Not found");
    }
Leave a Comment