title: SpringBoot JPA repository save method not working
body: <p>I will get List of JSONs from my MobileApp and I am converting those to a DataModel and then trying to insert the list of dataModel as a bulk.</p>
  
  <p>This is my Data Model or Entity Object.</p>
  
  <pre><code>import lombok.AllArgsConstructor;
  import lombok.Builder;
  import lombok.Data;
  import lombok.NoArgsConstructor;
  
  import javax.persistence.*;
  import java.time.OffsetDateTime;
  
  @Data
  @Builder
  @NoArgsConstructor
  @AllArgsConstructor
  @Entity
  @Table(name = "cab_boarding")
  public class CabBoardingModel {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      Long id;
  
      @Column(name = "gpid")
      String gpid;
  
      @Column(name = "latitude")
      Long latitude;
  
      @Column(name = "longitude")
      Long longitude;
  
      @Column(name = "vehicle_number")
      String vehicleNumber;
  
      @Column(name = "boarding_time")
      OffsetDateTime boardingTime;
  
  }
  </code></pre>
  
  <p>This is my Repository Interface </p>
  
  <pre><code>public interface CBRepository extends CrudRepository&lt;CabBoardingModel, Long&gt; {
  
      List&lt;CabBoardingModel&gt; findAll();
  
      List&lt;CabBoardingModel&gt; save(List&lt;CabBoardingModel&gt; cabBoardingModels);
  
      Optional&lt;CabBoardingModel&gt; findById(Long id);
  
  }
  </code></pre>
  
  <p>Below is the service tier that calls this <code>save</code> method</p>
  
  <pre><code>@Service
  public class CBService {
  
  
      private CBRepository cbRepository;
  
      @Autowired
      public CBService(CBRepository cbRepository) {
          this.cbRepository = cbRepository;
      }
  
  
      public List&lt;CabBoardingModel&gt; create(List&lt;CabBoardingModel&gt; cabBoardingModelList) {
          List&lt;CabBoardingModel&gt; cbCreatedList = cbRepository.save(cabBoardingModelList);
          return cbCreatedList;
      }
  }
  </code></pre>
  
  <p>Getting the below exception while accessing the save method</p>
  
  <pre><code> 2018-02-15 23:49:03.407 ERROR [smpoc-service-cabboarding,1b921dc7bf735306,1b921dc7bf735306,false] 2988 --- [nio-8080-exec-1] f.c.b.a.w.e.h.ControllerExceptionHandler : Unexpected exception
  
  org.springframework.beans.NotReadablePropertyException: Invalid property 'id' of bean class [java.util.ArrayList]: Could not find field for property during fallback access!
      at org.springframework.data.util.DirectFieldAccessFallbackBeanWrapper.getPropertyValue(DirectFieldAccessFallbackBeanWrapper.java:56) ~[spring-data-commons-1.13.10.RELEASE.jar:na]
      at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.getId(JpaMetamodelEntityInformation.java:149) ~[spring-data-jpa-1.11.10.RELEASE.jar:na]
      at org.springframework.data.repository.core.support.AbstractEntityInformation.isNew(AbstractEntityInformation.java:51) ~[spring-data-commons-1.13.10.RELEASE.jar:na]
      at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.isNew(JpaMetamodelEntityInformation.java:227) ~[spring-data-jpa-1.11.10.RELEASE.jar:na]
      at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:507) ~[spring-data-jpa-1.11.10.RELEASE.jar:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:513) ~[spring-data-commons-1.13.10.RELEASE.jar:na]
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:498) ~[spring-data-commons-1.13.10.RELEASE.jar:na]
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:475) ~[spring-data-commons-1.13.10.RELEASE.jar:na]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.14.RELEASE.jar:4.3.14.RELEASE]
      at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56) ~[spring-data-commons-1.13.10.RELEASE.jar:na]
  </code></pre>