Issue
I'm making a query that will return a multiple of rows, I need to find a way to loop through these rows and extract a value from each row.
How can I make a for loop that will start from the first row and end at the last ?
repo = findbyID
for (int i = ? ; i = ? ; ? ) // Id's are not in order and can be somthing like 5,2,10,12...
Solution
To solve this issue I had to make the object passed to the method of type List. Then I had to figure out a way to loop through this list, so I used for loop, ex:
for (InvoiceDTO invoices : invoiceDTO) {
//your code
}
Now, problem is solved.
Answered By - DarkBot
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)