Tim Holloway wrote:I looked at that project. It's not from Baeldung, which explains why it's not self-contained. It's also not a "project" as such, but rather a set of different sub-projects collected together to make a downloadable whole. The sub-projects each have README files that link to an article and can be built and tested individually. For example:
The top (root)-level POM can build the sub-projects in bulk, but you do have to follow the instructions in the README, since this multi-project project has some stuff that requires Java 8 and some that requires Java 9 and later and since there was a major break in how Java handles introspection between the two versions, they're handled differently.
Yes, the sub-projects I try to run is
spring-data-jpa-repo, the relevant articles is
Spring Data – CrudRepository save() Method
it has three pom.xml (one pom, and inherit two from parents),
tutorials\persistence-modules\spring-data-jap-repo\pom.xml
tutorials\parent-boot-2\pom.xml
tutorials\pom.xml
I add
in tutorials\persistence-modules\spring-data-jap-repo\pom.xml,
then run
{path} \tutorials\persistence-modules\spring-data-jpa-repo> mvn spring-boot:run
but it returns many error like
2023-01-26 00:54:56.029 INFO 12620 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data
JDBC repositories in DEFAULT mode.
2023-01-26 00:54:56.032 INFO 12620 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data JDBC - Could not safely identify store assignment for repository candid
ate interface com.baeldung.derivedquery.repository.UserRepository; If you want this repository to be a JDBC repository, consider annotating your entities with one of these annotations:
org.springframework.data.relational.core.mapping.Table.
..........\\ other error
2023-01-26 00:54:59.766 WARN 12620 --- [ main] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL "cre
ate table car (id bigint generated by default as identity, model varchar(255), year integer, primary key (id))" via JDBC Statement
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table car (id bigint generated by default as identity, model varchar(255), year integer, primary k
ey (id))" via JDBC Statement
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.6.12.Final.jar:5.6.12.Final]
at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:458) ~[hibernate-core-5.6.12.Final.jar:5.6.12.Final]
at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:442) ~[hibernate-core-5.6.12.Final.jar:5.6.12.Final]
and the article
https://www.baeldung.com/spring-data-crud-repository-save
has not mentioned how to run the code, so don't know what to do.