title: repository.save uses insert instead of update
body: <p>I am using TypeORM's repository pattern with a simple table, two columns, <code>estate_num</code> as primary key and <code>estateId</code> with mysql.</p>
  
  <p>The <code>repository.save</code> <a href="http://typeorm.io/#/repository-api" rel="noreferrer">method is supposed</a> to insert if the record by primary key does not exist, otherwise, update it.</p>
  
  <p>Instead, I get the following error:</p>
  
  <pre><code>query: SELECT `estate`.`estate_num` AS `estate_estate_num`, `estate`.`estateId` AS `estate_estateId` FROM `estate` `estate` WHERE (`estate`.`estate_num` = ?) -- PARAMETERS: ["0"]
  query: START TRANSACTION
  query: INSERT INTO `estate`(`estate_num`, `estateId`) VALUES (?, ?) -- PARAMETERS: ["0","caae4e67796e4ac000743f009210fcb0467fdf87d0fbbf6107359cf53f5b544b79eefdfdd78f95d50301f20a9c3212cd3970af22b722e59313813e8c5d2732d0"]
  query failed: INSERT INTO `estate`(`estate_num`, `estateId`) VALUES (?, ?) -- PARAMETERS: ["0","caae4e67796e4ac000743f009210fcb0467fdf87d0fbbf6107359cf53f5b544b79eefdfdd78f95d50301f20a9c3212cd3970af22b722e59313813e8c5d2732d0"]
  error: { Error: ER_DUP_ENTRY: Duplicate entry '0' for key 'PRIMARY'
  </code></pre>
  
  <p>I can run the <code>SELECT</code> manually, which is what I think determines whether to insert vs update. It returns a row as I would expect with the matching <code>estate_num</code>.</p>
  
  <p>The entity model for this is:</p>
  
  <pre><code>@Entity()
  export class Estate {
    @PrimaryColumn({
      name: 'estate_num',
    })
    estateNum: number;
  
    @Column({
      name: 'estateId',
    })
    estateId: string;
  }
  </code></pre>
  
  <p>Note: the <code>estate_num</code> is <em>not</em> auto-increment, the key will be always supplied. It is odd, I understand.</p>
  
  <p>Thanks!</p>