Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • To check the resultant type: stackoverflow.com/questions/709961/… Commented Jul 17, 2013 at 6:25
  • Thanx Karna, But If I use "getGenericType" I need to hard code all the types in some where right. I don't want to hard code anything. Is there anyway to not hard code the values...? Correct me if I am wrong... Commented Jul 17, 2013 at 6:29
  • @Amar: Yes, but what can be the other distinguishing factor between fields you want to consider and other fields? As Andre mentioned in comment you can use some annotation on fields to achieve the same. Commented Jul 17, 2013 at 7:51
  • @Karna thanx for your update. You said use some annotation on fields to achieve the same. What kind of annotations and how can we use in my java/pojo class...? Commented Jul 17, 2013 at 9:39
  • Thanx @Karna I like this approach. Commented Jul 25, 2013 at 5:00