title: Mysql Spring Data JPA boolean
body: <p>I have problem with boolean type in my Action class.</p>
  
  <p>My table in mysql have column 'removed' which is BIT(1) type with default value 0.</p>
  
  <pre><code>@Entity
  @Table(name = "Actions")
       public class Action {
        //other fields
  
        @Column(name = "removed")
        private boolean removed;
  
        //setters and getters
        }
  </code></pre>
  
  <p>When I tried to compile my Spring Boot App I saw errors like:</p>
  
  <pre><code>          Caused by: org.springframework.data.mapping.PropertyReferenceException: No property by found for type boolean! Traversed path: Action.removed.
              at org.springframework.data.mapping.PropertyPath.&lt;init&gt;(PropertyPath.java:77) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:329) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:309) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:339) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:363) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:309) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:272) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:243) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.query.parser.Part.&lt;init&gt;(Part.java:76) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.query.parser.PartTree$OrPart.&lt;init&gt;(PartTree.java:235) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:373) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.query.parser.PartTree$Predicate.&lt;init&gt;(PartTree.java:353) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.query.parser.PartTree.&lt;init&gt;(PartTree.java:87) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.&lt;init&gt;(PartTreeJpaQuery.java:63) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
              at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:103) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
              at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:214) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
              at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:77) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
              at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.&lt;init&gt;(RepositoryFactorySupport.java:435) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:220) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:266) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:252) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
              at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:92) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
              ... 44 common frames omitted
  </code></pre>
  
  <p>I tried other anotations to my Action removed field like:</p>
  
  <pre><code>@Column(name = "removed",columnDefinition = "BIT", length = 1)
  @Column(name = "removed",columnDefinition = "TINYINT", length = 1)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>@Type(type = "org.hibernate.type.NumericBooleanType")
  </code></pre>
  
  <p>but no does not work...</p>
  
  <p>My ActionDao interface:</p>
  
  <pre><code> public interface ActionDao extends CrudRepository&lt;Action, Integer&gt;{
  public Action findByActionname(String actionname);
  public List&lt;Action&gt; findAllByRemovedByOrderByActionnameAsc(boolean removed);}
  </code></pre>
  
  <p>my pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.38&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>and application.properties</p>
  
  <pre><code>        spring.datasource.url=jdbc:mysql://localhost/System?useUnicode=yes&amp;characterEncoding=UTF-8
      spring.datasource.username=root
      spring.datasource.password=test
      spring.datasource.driver-class-name=com.mysql.jdbc.Driver
      spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
      spring.jpa.show-sql=true
      spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
      spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      spring.jpa.hibernate.ddl-auto=validate
  </code></pre>
  
  <p>Anyone can help me ? </p>