hi ranchers.. shree here
i have been using using collection for displaying data in combo box. but when i put collection of class objects in session it takes too much of memory. insted i want to load a collection of data having only primary key & another field data in the new collection. (it can be done using iterator & other stuff , but it again takes lot of processing)
i am using hibernate criterea to get a collection.
is there any way so that i can get collection of class object with data in only required fields or casting it into new class with only two fields.
thank you all
I am not sure if this is a hibernate specific query, but copying the fields of a class in a list to another class, can be achieved using the BeanUtils class in apache-beanutils.jar. [So that you dont have to do the copying, identifying fields to copy etc, yourself.]
...will copy all the similar named fields in Class1 to Class2. Ofcourse, you will have to do the iteration yourself.
I know this might not be the exact answer you might be looking at, but possibly will invoke a thought on how it could be done more efficiently than your current situation
What's that smell? Hey, sniff this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!