If you find any mistakes, then please raise an issue in this repository or email me at hinkula(at)gmail.com.
By default, you can use JPQL (Java Persistence Query Language). You can use JPQL to select entities from the database based on a certain condition (The book example is JPQL). If you want to use SQL, you have to set nativeQuery
attribute value to true
, as shown in the following example.
@Query(value = "SELECT * FROM USERS u WHERE id = 1", nativeQuery = true)
In Spring Boot 3, PagingAndSortingRepository
extends Repository
.
The image referenced as Figure 3.16 on Page 52 under Chapter 3, Using JPA to Create and Access a Database under Adding relationships between tables is incorrectly placed. It should appear later in Chapter 5 after the creation of the user entity.
There is type in the first code example which demonstrates use of +-operator. The correct code is the following:
let greeting = "Hello " + person.firstName + " " + person.lastName
js.coach site is not available anymore. You can use Awesome React Components https://github.com/brillout/awesome-react-components.
The figure shows an extra column Owner Login that is not in the code.
Vitest released version 1.0, which requires Vite version 5. ,You can solve this by installing Vitest version 0.36 that is compatible with Vite version 4. See the installation command below:":
npm install -D vitest@0.34.3 @testing-library/react @testing-library/jest-dom jsdom
In the CarList.tsx file, update the conditional rendering logic to handle loading and error states properly.
Replace:
const { data, error, isSuccess } = useQuery({
queryKey: ["cars"],
queryFn: getCars
});
if (!isSuccess) {
return Loading...
}
else if (error) {
return Error when fetching cars...
}
else {
...
}
With:
const { data, isSuccess, isError, isLoading } = useQuery({
queryKey: ["cars"],
queryFn: getCars
});
if (isLoading) {
return Loading...
}
else if (isError) {
return Error when fetching cars...
}
else if (isSuccess) {
...
}