title: Unable to evaluate the expression Method threw 'org.hibernate.exception.GenericJDBCException' exception
body: <p>I have 2 models in my application which have the one-to-many and many-to-one relationships.</p>
  
  <p>The model classes are:</p>
  
  <p><strong>Invoice Model</strong></p>
  
  <pre><code>@Entity
  @Data
  public class Invoice implements java.io.Serializable {
      @Id
      @GeneratedValue(generator = "system-uuid")
      @GenericGenerator(name = "system-uuid", strategy = "uuid2")
      private String id;
  
      private String business;
  
      private String client;
  
      private String invoiceNo;
  
      @Enumerated(EnumType.STRING)
      private InvoiceStatus status;
  
      private String additionalInfo;
  
      @OneToMany(mappedBy = "invoice")
      private Set&lt;InvoiceItem&gt; items = new HashSet&lt;&gt;();
  
      @CreationTimestamp
      private LocalDateTime createdAt;
  
      @UpdateTimestamp
      private LocalDateTime updatedAt;
  
      private LocalDateTime deletedAt;
  }
  </code></pre>
  
  <p><strong>InvoiceItem Model</strong></p>
  
  <pre><code>@Entity
  @Data
  public class InvoiceItem {
      @Id
      @GeneratedValue(generator = "system-uuid")
      @GenericGenerator(name = "system-uuid", strategy = "uuid2")
      private String id;
  
      @ManyToOne
      @JoinColumn(name="invoice_id", nullable = false)
      private Invoice invoice;
  
      private String description;
  
      @Enumerated(EnumType.STRING)
      private InvoiceItemType type;
  
      @CreationTimestamp
      private LocalDateTime createdAt;
  
      @UpdateTimestamp
      private LocalDateTime updatedAt;
  
      private LocalDateTime deletedAt;
  }
  </code></pre>
  
  <p>I have an api endpoint which is used to create an invoiceItem for an invoice</p>
  
  <pre><code>@RestController
  @RequestMapping(path="/api/v1/invoices/{invoice}/items")
  public class InvoiceItemController {
  
      @Autowired
      private ModelMapper modelMapper;
  
      @Autowired
      private InvoiceItemService invoiceItemService;
  
      @Autowired
      private InvoiceService invoiceService;
  
      @PostMapping
      public ResponseEntity&lt;InvoiceItem&gt; addInvoiceItem(@PathVariable("invoice") String invoiceId, @RequestBody InvoiceItemCreationDto invoiceItemCreationDto) throws NotFoundException {
  
          Optional&lt;Invoice&gt; invoiceOptional = invoiceService.findInvoiceById(invoiceId);
  
          if (!invoiceOptional.isPresent()) {
              throw new NotFoundException("Invoice not found");
          }
  
          InvoiceItem invoiceItem = modelMapper.map(invoiceItemCreationDto, InvoiceItem.class);
          invoiceItem.setInvoice(invoiceOptional.get());
  
          InvoiceItem savedInvoiceItem = invoiceItemService.addInvoiceItem(invoiceItem);
          return new ResponseEntity&lt;&gt;(savedInvoiceItem, HttpStatus.CREATED);
      }
  }
  </code></pre>
  
  <p><strong>Invoice Service</strong></p>
  
  <pre><code>package com.spencerfeng.invoiceservice.services;
  
  import com.spencerfeng.invoiceservice.models.Invoice;
  import com.spencerfeng.invoiceservice.repositories.InvoiceRepository;
  import org.springframework.beans.factory.annotation.Autowired;
  
  import java.util.Optional;
  
  public class InvoiceServiceImpl implements InvoiceService {
      @Autowired
      InvoiceRepository invoiceRepository;
  
      @Override
      public Invoice addInvoice(Invoice invoice) {
          return invoiceRepository.save(invoice);
      }
  
      @Override
      public Optional&lt;Invoice&gt; findInvoiceById(String id) {
          return invoiceRepository.findById(id);
      }
  }
  </code></pre>
  
  <p><strong>Invoice Repository</strong></p>
  
  <pre><code>package com.spencerfeng.invoiceservice.repositories;
  
  import com.spencerfeng.invoiceservice.models.Invoice;
  import org.springframework.data.repository.CrudRepository;
  
  public interface InvoiceRepository extends CrudRepository&lt;Invoice, String&gt; {
  }
  </code></pre>
  
  <p><strong>InvoiceItem Service</strong></p>
  
  <pre><code>package com.spencerfeng.invoiceservice.services;
  
  import com.spencerfeng.invoiceservice.models.InvoiceItem;
  import com.spencerfeng.invoiceservice.repositories.InvoiceItemRepository;
  import org.springframework.beans.factory.annotation.Autowired;
  
  public class InvoiceItemServiceImpl implements InvoiceItemService {
      @Autowired
      private InvoiceItemRepository invoiceItemRepository;
  
      @Override
      public InvoiceItem addInvoiceItem(InvoiceItem invoiceItem) {
          return invoiceItemRepository.save(invoiceItem);
      }
  }
  </code></pre>
  
  <p>But when I call this api endpoint to create an invoiceItem for an invoice, the items property in the invoiceOptional has the 'Unable to evaluate the expression Method threw 'org.hibernate.exception.GenericJDBCException' exception, while other properties are fine.</p>
  
  <p><a href="https://i.stack.imgur.com/Mripm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Mripm.png" alt="The screenshot of the issue"></a></p>
  
  <p><a href="https://i.stack.imgur.com/2uGEL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2uGEL.png" alt="enter image description here"></a></p>