I'm new to Hibernate, and need some advice on two different POJO implementation approaches for each hbm definition. For every property that I define inside Hibernate hbm file, the first approach is to declare private member variables, and corresponding getters and setters functions. The second approach is to create a Map variable that will hold all values (using property name as the key) as Object, and still have the getters and setters with the proper type cast.
Either approach can work. I need some advice as to the pros and cons. I know that the using Map to store values will require field type such as int to do a conversion to object before storing into Map. This is slower and uses more memory. Are there any other arguments?
Thanks.
|