title: Spring boot jpa cannot update simple object on postgres database
body: <p>I have a spring boot application with postgres database</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
      &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
      &lt;version&gt;42.0.0.jre7&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.5.2.RELEASE&lt;/version&gt;
      &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p>i made a simple test to create a user, load it from the Db, change one of its properties and save it again</p>
  
  <p>but its not working</p>
  
  <p>here is my UserInterface</p>
  
  <pre><code>public interface UserService extends CrudRepository&lt;User, String&gt; {
  
      public final static String NORMAL_USER = "ROLE_user";
  
      public User findByEmail(String email);
  
      public User findByVerificationToken(String token);
  
  }
  </code></pre>
  
  <p>and my junit test</p>
  
  <pre><code>@Test
      public void activateUser(){
          User user = new User();
          user.setRegistrationDate(new Date());
          user.setEnabled(false);
          user.setEmail("junit@test.com");
          user.setPassword("12");
          userService.save(user);
  
          User dbUser = userService.findByEmail("junit@test.com");
          assertFalse(user.isEnabled());
          dbUser.setEnabled(true); 
          userService.save(dbUser); &lt;--- here it dies
  
          dbUser = null;
  
          User activatedUser = userService.findByEmail("junit@test.com");
          assertTrue(activatedUser.isEnabled());
      }
  </code></pre>
  
  <p>As mentioned the test creates the user, also the findByEmail works correctly
  but when i changed the persisted object and call the save method again i get the following exeption</p>
  
  <blockquote>
    <p>2017-05-03 18:49:20.242 ERROR 3852 --- [           main]
    o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: operator does not
    exist: character varying = bigint   Hint: No operator matches the
    given name and argument type(s). You might need to add explicit type
    casts.   Position: 581 2017-05-03 18:49:20.244  INFO 3852 --- [<br>
    main] o.h.e.internal.DefaultLoadEventListener  : HHH000327: Error
    performing load command : org.hibernate.exception.SQLGrammarException:
    could not extract ResultSet 2017-05-03 18:49:20.320  INFO 3852 --- [<br>
    Thread-5] o.s.w.c.s.GenericWebApplicationContext   : Closing
    org.springframework.web.context.support.GenericWebApplicationContext@3cc1435c:
    startup date [Wed May 03 18:49:12 COT 2017]; root of context hierarchy</p>
  </blockquote>
  
  <p>I can't understand the error since im not comparing anything....</p>
  
  <p>UPDATE - Adding the User class</p>
  
  <pre><code>@Entity
  @Table(name = "users")
  public class User implements UserDetails {
  
      private static final long serialVersionUID = -4009074751138066325L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "id")
      private Long userId;
  
      @Column(name = "first_name")
      private String firstName;
  
      @Column(name = "last_name")
      private String lastName;
  
      @Column(name = "auth_provider")
      private String authProvider;
  
      @Email
      @NotNull
      @Column(name = "email")
      private String email;
  
      @Column(name = "dob")
      private String dob;
  
      @Column(name = "doc_type")
      private String documentType;
  
  non args constructor and getters/setters
  }
  </code></pre>