title: How to map a PostgreSQL array with Hibernate
body: <p>has anyone successfully mapped a numeric array in PostgreSQL to a numeric array in java via Hibernate?</p>
  
  <p>sql:</p>
  
  <pre><code>CREATE TABLE sal_emp (name text, pay_by_quarter integer[]);
  INSERT INTO sal_emp VALUES ('one', '{1,2,3}');
  INSERT INTO sal_emp VALUES ('two', '{4,5,6}');
  INSERT INTO sal_emp VALUES ('three', '{2,4,6}');
  </code></pre>
  
  <p>
  </p>
  
  <p>mapping:</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
      &lt;class name="SalEmp" table="sal_emp"&gt;
          &lt;id name="name" /&gt;
          &lt;property name="payByQuarter" column="pay_by_quarter" /&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>class:</p>
  
  <pre><code>public class SalEmp implements Serializable{
      private String name;
      private Integer[] payByQuarter;
      ...// getters &amp; setters
  }
  </code></pre>
  
  <p>i get an exception when querying the table.</p>