title: Apache Thrift, Java: Object Data Types
body: <p>i'm stuck with Thrift about data types.</p>
  
  <p>Now when i map and Integer value to a thrift generated bean, i'm using i32 type in the idl definition. </p>
  
  <pre><code>class MyBean {
    Integer i = null;
  }
  
  struct TMyBean {
    1: i32 i;
  }
  </code></pre>
  
  <p>The problem is that in TMyBean generated bean, the i var is an int primitive type, than it's putting 0 as the default value, and for me 0 it's a valid value.</p>
  
  <p>I've tried to put the optional keyword in the idl file, but things are not changing, it's always int.</p>
  
  <p>How i've to handle this situation? i need i to accept a null value in TMyBean i var.</p>
  
  <p>Thanks, Phaedra..</p>