title: spring sql Invalid column name
body: <p>getting </p>
  
  <blockquote>
    <p>com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name
    'partnerIdPartner'.</p>
  </blockquote>
  
  <p><strong>application.properties:</strong></p>
  
  <pre><code>spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
  spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
  </code></pre>
  
  <p><strong>Table creation:</strong></p>
  
  <pre><code>CREATE TABLE [partnersystem] (
    [idPartnerSystem] INT IDENTITY(1,1)  ,
    [partner_idPartner] INT NOT NULL  DEFAULT NULL  ,
    [Name] NVARCHAR(45) NULL  DEFAULT NULL  ,
    [Domain] NVARCHAR(45) NULL  DEFAULT NULL  ,
    [Code] NVARCHAR(45) NULL  DEFAULT NULL  ,
    [PartnerSystem_idSystem] INT NOT NULL  DEFAULT NULL  ,
    [UpdateUser] NVARCHAR(45) NULL  DEFAULT NULL  ,
    [UpdateDT] DATETIME NULL  DEFAULT NULL  ,
   CONSTRAINT [partnersystem_PRIMARY]  PRIMARY KEY  CLUSTERED  ([idPartnerSystem]), CONSTRAINT [partnersystem_fk_PartnerSystem_partner] FOREIGN KEY ("partner_idPartner") REFERENCES "partner" ( "idPartner" ) ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT [partnersystem_fk_PartnerSystem_System] FOREIGN KEY ("PartnerSystem_idSystem") REFERENCES "system" ( "idSystem" ) ON UPDATE NO ACTION ON DELETE NO ACTION);
   CREATE  INDEX [partnersystem_fk_PartnerSystem_partner] ON [partnersystem] ([partner_idPartner]);
   CREATE  INDEX [partnersystem_fk_PartnerSystem_System] ON [partnersystem] ([PartnerSystem_idSystem]);
  </code></pre>
  
  <p>JPA Entity:</p>
  
  <pre><code>@Entity
  @Table(name = "partnersystem")
  public class PartnerSystem {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "idPartnerSystem")
      private int idPartnerSystem;
  
  
      @Column(name = "partner_idPartner" )
      private int partnerIdPartner;
  
      @Column(name = "Name")
      private String name;
  
      @Column(name = "Domain" )
      private String domain;
  
      @Column(name = "Code" )
      private String code;
  
      @Column(name = "PartnerSystem_idSystem" )
      private int partnerSystemIdSystem;
  
      @Column(name = "UpdateUser" )
      private String updateUser;
  </code></pre>
  
  <p><strong>my repository:</strong></p>
  
  <pre><code> @Repository
      public interface PartnerSystemRepository extends JpaRepository&lt;PartnerSystem, 
    Integer&gt;{
  
          public PartnerSystem findByPartnerIdPartner(int partnerIdPartner);
      }
  </code></pre>
  
  <p>executing simple query throws an error.  </p>
  
  <pre><code>public List&lt;Object[]&gt; findAllPartnerSystem(int id) {
  
      String test = 
              "SELECT idPartnerSystem, partnerIdPartner, name, domain, code, partnerSystemId" + 
              " FROM PartnerSystem  " +
              "WHERE partnerIdPartner = ?"
              ;
      Query query = em.createNativeQuery(test);
  
      query.setParameter(1, id);
      List&lt;Object[]&gt; results = query.getResultList();
  
      for (Object[] row : results) {
  
      }
      return results;
  }
  </code></pre>