Let, say for instance i have a POJO class employee with three attributes
1.Name (String) 2.Location (String) 3.Date of Birth (Date)
then i fired a query into database which retrieve first row of table and populate this POJO with table data as follows:-
Name - john location - USA Date of Birth - 27/09/2014
To retrieve the values from this POJO i have to call getName(),getLocation() and getDOB().
But is there any method by which i can get all the values which is store in the POJO, in an Object type array without using getter method
for example:
Object[0] has the value "John".
Object[1] has the value "USA".
Object[2] has the value "27/09/2014".
(In my case, there are around 80 attributes in a class and number of these attributes increases because of client requirements and i am fetching each and every value by getter method and every time a single attribute is added i have to write a getter method in the code to fetch values. I basically want a more dynamic solution to this problem.)