title: How could use one to one mapping in mybatis with spring boot?
body: <p>In my Spring Boot project I am using MyBatis. I want to know how to use one to one mapping and how to created POJOs for the mapping classes. This is the SQL dump I have used:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE IF NOT EXISTS LANG(
  ID  BIGINT(10) NOT NULL AUTO_INCREMENT,     
  CODE VARCHAR(3) UNIQUE,
  NAME VARCHAR(150),
  PRIMARY KEY (ID)
  );
  
  CREATE TABLE IF NOT EXISTS PROVINCE(
  ID  BIGINT(10) NOT NULL AUTO_INCREMENT, 
  CODE VARCHAR(10) UNIQUE,        
  NAME VARCHAR(200),
  LANG_CODE VARCHAR(3),
  PRIMARY KEY (ID),
  FOREIGN  KEY(LANG_CODE) REFERENCES LANG(CODE)
  );
  </code></pre>
  
  <p>and POJOs are,</p>
  
  <blockquote>
    <p>Language.java</p>
  </blockquote>
  
  <pre class="lang-java prettyprint-override"><code>public class Language {
  
      private long id;
  
      private String code;
  
      private String name;
  
      public long getId() {
          return id;
      }
  
      public void setId(long id) {
          this.id = id;
      }
  
      public String getCode() {
          return code;
      }
  
      public void setCode(String code) {
          this.code = code;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }   
  }
  </code></pre>
  
  <blockquote>
    <p>Province</p>
  </blockquote>
  
  <pre class="lang-java prettyprint-override"><code>public class Province {
  
      private long id;
  
      private String code;
  
      private String name;
  
      private String lang_code;
  
      public long getId() {
          return id;
      }
  
      public void setId(long id) {
          this.id = id;
      }
  
      public String getCode() {
          return code;
      }
  
      public void setCode(String code) {
          this.code = code;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getLang_code() {
          return lang_code;
      }
  
      public void setLang_code(String lang_code) {
          this.lang_code = lang_code;
      }
  }
  </code></pre>