Hi all,
I have a table with three columns.
Type
Code
Description
It's a look up table. So type +code make the primary key. I want to retrieve this data in a way that can be stored in hashmap. The key of map is type and value is list of objects . (The object is basically a bean with properties Code and Description)
The way I am doing it right now
1. get a list of all types then
2. Get the list of object based on each type
So if I have total 14 distinct types, I am making 15 queries to retrieve the data. Is that the right approach. Here is my mapping xml look like
DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<!-- This is designed keeping in mind the retrieve -->
<hibernate-mapping >
<class name="GenTable" table="GenTable">
<id name="type" type="string" column="GTType" >
<generator class="assigned"/>
</id>
<component name="entry" class="Entry">
<property name="code" >
<column name="CODE" />
</property>
<property name="desc" >
<column name="DESC" />
</property>
</component>
</class>
</hibernate-mapping>
TIA
Jas
"Attention: This message is intended only for the individual to whom it is addressed and may contain information that is confidential or privileged. If you are not the intended recipient, or the employee or person responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution, copying or use is strictly prohibited. If you have received this communication in error, please notify the sender and destroy or delete this communication immediately."