Relative Content

Tag Archive for javaspring-bootspring-data-jpa

findAll() method always returns data

I am using the findAll() method in spring data jpa to return a list of orders and I wrap them in Optional class. Within the method implementation I check if there is a data in the optional to return it or to throw a run time exception. My tables are empty, and I still got 200 code status with an empty list, why the exception is not thrown. always the if block executed?

Spring Boot Entity Relationship Cascade Remove Issue

When delete User record, I want to delete rfid record And when deleting rfid record not want to delete user record , only one rfid allow to use for one user (one to one relationship) also i don’t need to store rfid record id in user record. how to achieve this?