title: Unable to convert between java.lang.Integer and BINARY.- Spring
body: <p>I have the following DTO that I use to persist new records to my database</p>
  
  <pre><code>@Entity(name = "User")
  public class User {
  
  @Id
  @Column(name = "User_Id")
  private long userId;
  
  @Column(name = "User_Name")
  private String userNm;
  
  @Column(name = "years_active")
  private long years;
  
  @ManyToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "Manager_Id", insertable = false, updatable = false)
  private Manager manager;
  
  @Column(name = "Projects",insertable = false, updatable = false)
  private LinkedHashMap&lt;Long, String&gt; projects;
  
  @Column(name = "Projects")
  private long projectId;
  
  @Column(name = "address")
  private Address address;
  
  //getters &amp; setters
  
  }
  </code></pre>
  
  <p>DDL:</p>
  
  <pre><code>CREATE TABLE [dbo].[User] (
  [User_Id] int NOT NULL,
  [User_Name] varchar(255) NOT NULL,
  [years_active] int NOT NULL,
  [Manager_id] int NOT NULL, //FK to Manager table
  [Projects] int NOT NULL,   //FK to Project table
  [Address] int NULL,        //FK to Address Table
  [ModifiedBy] varchar(255) NOT NULL,
  [ModifiedTS] datetime NULL)
  </code></pre>
  
  <p>I have no problem persisting data to this table via form submission, however when I try to retrieve an entity object using Spring Repository:</p>
  
  <pre><code>User user = userRepo.findOne(id); // id == Long, passed through @Controller method
  </code></pre>
  
  <p>I consistently get the following error : <code>Unable to convert between java.lang.Integer and BINARY.</code></p>
  
  <pre><code>o.h.engine.jdbc.spi.SqlExceptionHelper   : Unable to convert between java.lang.Integer and BINARY.
  o.h.e.internal.DefaultLoadEventListener  : HHH000327: Error performing load command : 
  org.hibernate.exception.DataException: Could not read entity state from ResultSet : EntityKey[com.myapp.entities.User#3]
  </code></pre>
  
  <p>I'm not sure where this conversion between integer and Binary is happening; any ideas?</p>