title: ERROR: column "image" is of type bytea but expression is of type oid in Postgres using Jhipster
body: <p>I'm getting this error with a Jhipster App deployed on GAE (Postgres 9.6) which I'm not getting in local DB H2: </p>
  
  <pre><code>common frames omitted Caused by: org.postgresql.util.PSQLException: ERROR: column "image" is of type bytea but expression is of type oid
  </code></pre>
  
  <p>from an entity Photo:</p>
  
  <pre><code>package es.mibar.web.domain;
  
  import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  import org.hibernate.annotations.Cache;
  import org.hibernate.annotations.CacheConcurrencyStrategy;
  
  import javax.persistence.*;
  import javax.validation.constraints.*;
  
  import java.io.Serializable;
  import java.time.Instant;
  
  /**
   * A Photo.
   */
  @Entity
  @Table(name = "photo")
  @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
  public class Photo implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
      @SequenceGenerator(name = "sequenceGenerator")
      private Long id;
  
      @NotNull
      @Column(name = "creation_date", nullable = false)
      private Instant creationDate;
  
      @Lob
      @Column(name = "image")
      private byte[] image;
  
      @Column(name = "image_content_type")
      private String imageContentType;
  
      @Size(min = 2, max = 25000)
      @Column(name = "description", length = 25000)
      private String description;
  
      @ManyToOne(optional = false)
      @NotNull
      @JsonIgnoreProperties("photos")
      private Local local;
  
      @ManyToOne
      @JsonIgnoreProperties("photos")
      private Course course;
  </code></pre>
  
  <p>JDL:</p>
  
  <pre><code>entity Photo {
      creationDate Instant required,
      image ImageBlob,
      description String minlength(2) maxlength(25000)
  }
  </code></pre>
  
  <p>I have no idea though may be this is a hint: <a href="https://stackoverflow.com/questions/4488693/hibernate-postgresql-column-x-is-of-type-oid-but-expression-is-of-type-byte">Hibernate, Postgresql: Column &quot;x&quot; is of type oid but expression is of type byte</a></p>
  
  <p>But I'm not sure if this is a bug (since I haven't mofidied that entity) and it should be fixed in Jhipster or that solution could be applied.</p>
  
  <p>Thanks for you help. </p>