As I don't know what Order looks like, I'm going to make some assumptions in this answer. The big assumption I'm going to make is that you have an Integer id value in the class, which I can get using getId();. I'm also going to assume that the value is fixed - in other words, once the id has been applied, it's completely immutable and that's the value that would be saved to the database.
Now, if you really have to get your data like this, then I would be looking to use the filter capability in Java. Something like this:
private Optional<Order> findOrder(List<Order> orders, Order order) {
return orders.stream().filter(f -> f.getId() == order.getId()).findAny();
}
Then you would call this inside your loop like this
Optional<Order> foundOrder = findOrder(orderData, data);
if (foundData.isPresent()) {
}
Without more information, I can't really give you a more optimised solution.