TheXFed wrote:
Are the columns you need static, or would they change frequently? If they would be generally the same, you should be able to create multiple entities that map to the same table, each only specifying a subset of the available columns.
i'll explain it in detail once more
1) suppose i have a table with 80 fields
2) i never rule out the chances of fields being static
2) at time t1 i need to retrieve fields f1,f2,...f10
time t2 i need fields f5,f2,...f15
time tn i need fields fn,...fm
3) if i am going to provide a method for each t's in my DAO , i will be drowned in my DAO class
4) if i load all the fields each time , i may have performance probs (what if i have 500 tables like this and i have limited memory and processing power)
5) all these cases apply to more number of tables . so multiple mapping on a table is not encouraged
6) the problem is increased if i retrieve the data in different collections like list , set or map each time
i really need a design pattern or a generic class that deals with this situation :)
can i make use of the new generic DAO class mentioned in hiberate.org . And i'll be happy to rethink on my application design / schema design at this point of time .