title: How to design tables for data dictionary when using hibernate?
body: <p>I have a data dictionary table like this:</p>
  
  <pre><code>tbl_data_dictionary
  
  filed
  
  type code code_name
  
  rows
  
  sex 1 boy
  
  sex 2 girl
  
  country 1 American
  
  country 2 China
  </code></pre>
  
  <p>I have a data table:</p>
  
  <pre><code>field
  
  name sex_code country_code
  
  rows
  
  vivic 1 2
  </code></pre>
  
  <p>How to I use hibernate to map the code to code name? The one_to_many mapping settings seems not to fit my needs. Is the only way to separate the tbl_data_dictionary to tbl_sex and tbl_country? But, if I have lots of types of dictionaries, and in one type there aren't many rows, I feel it's a waste. Can hibernate map like this: <code>sex_code=code and type="sex"</code>?</p>