How to get Java reflect to spot fields in the super class? not just the actual class [duplicate]
This question already has an answer here: Retrieving the inherited attribute names/values using Java Reflection 12 answers I've recently changed my schema a bit so my classes inherit from a super class, problem is my comparison method which generates an audit log, using Java reflect, is now only looping through the fields of the child class, not the superclass, is there a way to get all the FIELDS? or do I need to cast it into the super class.....? Heres my method below: public static <T> String GenerateChangeLogForEntity(T old, T updated) { String text = ""; try { Field[] fields = old