title: ORA-00904: : invalid identifier Issue with Hibernate Dependent objects program
body: <p>I am working on a simple <a href="http://docs.jboss.org/hibernate/orm/4.2/manual/en-US/html/ch09.html#components-dependentobjects" rel="noreferrer">hibernate dependent objects</a> program using <code>Oracle</code> as my database.</p>
  
  <p>Here are my POJO classes:</p>
  
  <p><strong>Person</strong></p>
  
  <pre><code>public class Person {
      private java.util.Date birthday;
      private Name name;
      private String key;
      ... getters &amp; setters ...
  }
  </code></pre>
  
  <p><strong>Name</strong></p>
  
  <pre><code>public class Name {
      char initial;
      String first;
      String last;
          ... getters &amp; setters ...
  }
  </code></pre>
  
  <p>Hibernate mapping file:</p>
  
  <p><strong>person.hbm.xml</strong></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
      &lt;class name="Person" table="person1"&gt;
          &lt;id name="Key" column="pid" type="string"&gt;
              &lt;generator class="uuid" /&gt;
          &lt;/id&gt;
          &lt;property name="birthday" type="date" /&gt;
          &lt;component name="Name" class="Name"&gt; &lt;!-- class attribute optional --&gt;
              &lt;property name="initial" /&gt;
              &lt;property name="first" /&gt;
              &lt;property name="last" /&gt;
          &lt;/component&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>I have set the <code>hbm2ddl.auto</code> property as <code>update</code> in my <code>hibernate.cfg.xml</code> file so tables are created when I execute my program.</p>
  
  <p>Here is my simple program that tries to save an instance of Person object:</p>
  
  <pre><code>public class Program {
      public static void main(String[] args) {
          Session session = HibernateUtil.getSessionFactory().getCurrentSession();
          session.beginTransaction();
  
          Name name = new Name();
          name.setFirst("First");
          name.setLast("First");
          name.setInitial('I');
  
          Person person = new Person();
          person.setBirthday(new Date());
          person.setName(name);
  
          session.save(person);
  
          session.getTransaction().commit();
          HibernateUtil.getSessionFactory().close();
      }
  }
  </code></pre>
  
  <p>Now when I am executing this program, I am getting error while creation of table itself:</p>
  
  <blockquote>
    <p>15:20:45,376 ERROR SchemaUpdate:235 - HHH000388: Unsuccessful: create
    table person1 (pid varchar2(255) not null, birthday date, initial
    char(1), first varchar2(255), last varchar2(255), primary key (pid))</p>
    
    <p>15:20:45,376 ERROR SchemaUpdate:236 - ORA-00904: : invalid identifier</p>
  </blockquote>
  
  <p>I tried changing names of my properties in <code>Person</code> class as well as <code>Name</code> class but still I am facing this issue. Please let me know where I am doing mistake?</p>