title: Hibernate inserting null value?
body: <p>I am inserting a record into the database using Spring Data ReST Repository with Hibernate and Postgres database and for some reason a null value is being passed to a Boolean field (isActive field below) even though I do pass in the value from the ReST client.  This is throwing a constraint violation exception as this field is set to not null in the database.</p>
  
  <p>Here is the entity:</p>
  
  <pre><code>package com.stsi.pss.domain.Model.LookupEntities;
  
  import com.fasterxml.jackson.annotation.JsonIdentityInfo;
  import com.fasterxml.jackson.annotation.ObjectIdGenerators;
  import com.stsi.pss.domain.Base.AuditedEntity;
  import com.stsi.pss.domain.Model.PersonnelEntity;
  import org.springframework.data.jpa.domain.support.AuditingEntityListener;
  
  import javax.persistence.*;
  import java.util.HashSet;
  import java.util.Objects;
  import java.util.Set;
  
  @Entity
  @Table(name = "Personnel_Types", schema = "dbo", catalog = "SEVIS-CAD")
  @EntityListeners(AuditingEntityListener.class)
  @JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@id")
  
  public class PersonnelTypesEntity extends AuditedEntity&lt;String&gt; {
      private long id;
      private String description;
      private Boolean isActive;
  
      @Id
      @Column(name = "PersonnelTypeId", nullable = false)
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      public long getId() {
          return id;
      }
  
      public void setId(long id) {
          this.id = id;
      }
  
      @Basic
      @Column(name = "Description", nullable = true, length = 8000)
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      @Basic
      @Column(name = "IsActive", nullable = false)
      public Boolean getIsActive() {
          return isActive;
      }
  
      public void setIsActive(Boolean isActive) {
          isActive = isActive;
      }
  
  
      @Override
      public boolean equals(Object o) {
          if (this == o) return true;
          if (!(o instanceof PersonnelTypesEntity)) return false;
          PersonnelTypesEntity that = (PersonnelTypesEntity) o;
          return getId() == that.getId() &amp;&amp;
                  Objects.equals(getDescription(), that.getDescription()) &amp;&amp;
                  Objects.equals(getIsActive(), that.getIsActive());
      }
  
      @Override
      public int hashCode() {
  
          return Objects.hash(getId(), getDescription(), getIsActive());
      }
  
      @OneToMany(mappedBy = "personnelType")
      public Set&lt;PersonnelEntity&gt; getPersonnel() {
          return personnel;
      }
      public void setPersonnel(Set&lt;PersonnelEntity&gt; personnel) {
          this.personnel = personnel;
      }
      private Set&lt;PersonnelEntity&gt; personnel = new HashSet&lt;PersonnelEntity&gt;();
  }
  </code></pre>
  
  <p>This is the call I make from the ReST client:</p>
  
  <pre><code>POST
  
  http://localhost:4444/pssv2/api/personneltypes/
  
  {
  
      "description": "terminated",
      "isactive": true
  }
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <pre><code>2018-04-23 09:22:53.693 DEBUG 16804 --- [nio-4444-exec-3] org.hibernate.SQL                        : insert into dbo.Personnel_Types (creationTime, creatorUserId, lastModificationTime, lastModifierUserId, Description, IsActive) values (?, ?, ?, ?, ?, ?)
  Hibernate: insert into dbo.Personnel_Types (creationTime, creatorUserId, lastModificationTime, lastModifierUserId, Description, IsActive) values (?, ?, ?, ?, ?, ?)
  2018-04-23 09:22:53.695 TRACE 16804 --- [nio-4444-exec-3] o.h.type.descriptor.sql.BasicBinder      : binding parameter [1] as [TIMESTAMP] - [Mon Apr 23 09:22:53 EDT 2018]
  2018-04-23 09:22:53.696 TRACE 16804 --- [nio-4444-exec-3] o.h.type.descriptor.sql.BasicBinder      : binding parameter [2] as [VARCHAR] - [sunil]
  2018-04-23 09:22:53.696 TRACE 16804 --- [nio-4444-exec-3] o.h.type.descriptor.sql.BasicBinder      : binding parameter [3] as [TIMESTAMP] - [Mon Apr 23 09:22:53 EDT 2018]
  2018-04-23 09:22:53.696 TRACE 16804 --- [nio-4444-exec-3] o.h.type.descriptor.sql.BasicBinder      : binding parameter [4] as [VARCHAR] - [sunil]
  2018-04-23 09:22:53.698 TRACE 16804 --- [nio-4444-exec-3] o.h.type.descriptor.sql.BasicBinder      : binding parameter [5] as [VARCHAR] - [terminated]
  2018-04-23 09:22:53.698 TRACE 16804 --- [nio-4444-exec-3] o.h.type.descriptor.sql.BasicBinder      : binding parameter [6] as [BOOLEAN] - [null]
  2018-04-23 09:22:53.711  WARN 16804 --- [nio-4444-exec-3] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 23502
  2018-04-23 09:22:53.711 ERROR 16804 --- [nio-4444-exec-3] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: null value in column "isactive" violates not-null constraint
    Detail: Failing row contains (5, 2018-04-23 09:22:53.691, sunil, 2018-04-23 09:22:53.691, sunil, terminated, null).
  2018-04-23 09:22:53.730 ERROR 16804 --- [nio-4444-exec-3] o.s.d.r.w.RepositoryRestExceptionHandler : could not execute statement; SQL [n/a]; constraint [isactive]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
  
  org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [isactive]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
  </code></pre>
  
  <p>Here is my repository:</p>
  
  <pre><code>package com.stsi.pss.domain.IRepository;
  
  import com.stsi.pss.domain.Model.LookupEntities.PersonnelTypesEntity;
  import org.springframework.data.jpa.repository.JpaRepository;
  import org.springframework.data.rest.core.annotation.RepositoryRestResource;
  import org.springframework.stereotype.Repository;
  
  @Repository
  @RepositoryRestResource(collectionResourceRel = "personneltypes", path = "personneltypes")
  
  public interface IPersonnelTypesRepository extends JpaRepository&lt;PersonnelTypesEntity, Long&gt; {
  }
  </code></pre>
  
  <p>Any clue on what may be going on?</p>