Contours found by findContours function has direction. Objects are counter clockwise, and holes are clockwise. So if you check signed area of each contour, you will know whether this is a hole or not by its sign. Signed area of contour can be calculated in following way:
contourArea(contour, true);
Of course using hierarchy is a good approach as well but I think this approach is simpler to understand and implement.