title: how to ignore a field in entity class for create table in mysql database?
body: <p>I have a simple hibernate sample that have an entity class. I add a field to entity class that i don't want to create a column for that field in table of database. how can i do that?</p>
  
  <p>my Entity class:</p>
  
  <pre><code>@Entity
  @Table(name = "person")
  public class PersonEntity {
  
  private Long id;
  private String emailEntity;
  private String nameEntity;
  private String familyEntity;
  private String cityEntity;
  private String phoneEntity;
  private Long orgId;
  private String province;    
  
  @Id
  @GeneratedValue
  public Long getId() {
      return id;
  }
  
  public void setId(Long id) {
      this.id = id;
  }
  
  @Column(name = "email")
  public String getEmailEntity() {
      return emailEntity;
  }
  
  public void setEmailEntity(String emailEntity) {
      this.emailEntity = emailEntity;
  }
  
  @Column(name = "name")
  public String getNameEntity() {
      return nameEntity;
  }
  
  public void setNameEntity(String nameEntity) {
      this.nameEntity = nameEntity;
  }
  
  @Column(name = "last_name")
  public String getFamilyEntity() {
      return familyEntity;
  }
  
  public void setFamilyEntity(String familyEntity) {
      this.familyEntity = familyEntity;
  }
  
  @Column(name = "city")
  public String getCityEntity() {
      return cityEntity;
  }
  
  public void setCityEntity(String cityEntity) {
      this.cityEntity = cityEntity;
  }
  
  @Column(name = "phone")
  public String getPhoneEntity() {
      return phoneEntity;
  }
  
  public void setPhoneEntity(String phoneEntity) {
      this.phoneEntity = phoneEntity;
  }
  
  @Column(name = "org_id")
  public Long getOrgId() {
      return orgId;
  }
  
  public void setOrgId(Long orgId) {
      this.orgId = orgId;
  }
  
  public String getProvince() {
      return province;
  }
  
  public void setProvince(String province) {
      this.province = province;
  }
  }
  </code></pre>
  
  <p>hibernate.cfg.xml:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
      &lt;!-- Database connection settings --&gt;
      &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306/emailDB&lt;/property&gt;
      &lt;property name="connection.username"&gt;root&lt;/property&gt;
      &lt;property name="connection.password"&gt;123&lt;/property&gt;
  
      &lt;!-- JDBC connection pool (use the built-in) --&gt;
      &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  
      &lt;!-- SQL dialect --&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  
      &lt;!-- Enable Hibernate's automatic session context management --&gt;
      &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
      &lt;!-- Disable the second-level cache  --&gt;
      &lt;property name="cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt;
  
      &lt;!-- Echo all executed SQL to stdout --&gt;
      &lt;property name="show_sql"&gt;false&lt;/property&gt;
  
      &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
      &lt;!--&lt;mapping class="net.viralpatel.hibernate.Employee"/&gt;--&gt;
      &lt;!--&lt;mapping class="net.viralpatel.hibernate.PersonEntity"/&gt;--&gt;
      &lt;mapping class="organizationsTab.PersonEntity"/&gt;
      &lt;mapping class="organizationsTab.OrgEntity"/&gt;
  
  
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>'province' field is an auxiliary field and I don't want to create a column for that in table. how can i do that?</p>