Get com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column
<p>I decided to test the Spring Boot. My project has next dependencies: JPA, MySql, WEB. I created simple MySql database. Here is a table from it:</p>

<pre><code>CREATE TABLE `rawtype` (
  `rtId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rtName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`rtId`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
</code></pre>

<p>Here is domain for this table:</p>

<pre><code>import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name="rawtype")
public class Rawtype implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name="rtId", nullable = false)
    @GeneratedValue
    private int rtId;

    @Column(name="rtName", nullable = false)
    private String rtName;

    protected Rawtype() {
    }

    public Rawtype(int rtId, String rtName) {
        this.rtId = rtId;
        this.rtName = rtName;
    }

    public int getRtId() {
        return rtId;
    }

    public void setRtId(int rtId) {
        this.rtId = rtId;
    }

    public String getRtName() {
        return rtName;
    }

    public void setRtName(String rtName) {
        this.rtName = rtName;
    }

    @Override
    public String toString() {
        return "Rawtype{" +
                "rtId=" + rtId +
                ", rtName='" + rtName + '\'' +
                '}';
    }
}
</code></pre>

<p>Trying to get all rows from this table with a JpaRepository method</p>

<pre><code>  List&lt;T&gt; findAll();
</code></pre>

<p>In the log I see that Hibernate executes this query:</p>

<pre><code>select rawtype0_.rt_id as rt_id1_0_, rawtype0_.rt_name as rt_name2_0_ from rawtype rawtype0_
</code></pre>

<p>And I get this error:</p>

<pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'rawtype0_.rt_id' in 'field list'
</code></pre>

<p>Could anyone suggest what should I do?
Thanks.</p>

<p>P.S.</p>

<p>RawtypeRepository.java</p>

<pre><code>import org.springframework.data.jpa.repository.JpaRepository;
import domain.Rawtype;

public interface RawtypeRepository extends JpaRepository&lt;Rawtype,Integer&gt; {
    }
</code></pre>

<p>RawtypeServiceImpl.java</p>

<pre><code>import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import domain.Rawtype;

import java.util.List;

@Service
@Transactional
public class RawtypeServiceImpl implements RawtypeService{

    @Autowired
    RawtypeRepository rawtypeRepository;

    public List&lt;Rawtype&gt; findAll() {
        return rawtypeRepository.findAll();
    }
}
</code></pre>