devonfw / devon4j

devonfw Java stack - create enterprise-grade business apps in Java safe and fast
Apache License 2.0
83 stars 87 forks source link

devon4j JpaInitializer documentation not matching releases #393

Closed hohwille closed 3 years ago

hohwille commented 3 years ago

This JavaDoc says that you need to add a spring-boot-starter-jpa:

https://github.com/devonfw/devon4j/blob/master/modules/jpa-basic/src/main/java/com/devonfw/module/jpa/dataaccess/api/JpaInitializer.java#L7

However, there is no such starter and has never been: https://repo1.maven.org/maven2/com/devonfw/java/starters/

So either we need to create such starter or change the documentation and explaing how to manually configure the @Bean properly to make this work... Should also be referenced from JpaHelper JavaDoc as otherwise this class is not usable and will fail with errors like:

java.lang.IllegalStateException: EntityManager has not yet been initialized!
    at com.devonfw.module.jpa.dataaccess.api.JpaEntityManagerAccess.getEntityManager(JpaEntityManagerAccess.java:38)
    at com.devonfw.module.jpa.dataaccess.api.JpaHelper.asEntity(JpaHelper.java:49)
    at org.example.app.ordermanagement.dataaccess.api.ItemEntity.setOrderId(ItemEntity.java:102)
...
hohwille commented 3 years ago

No starter required. All comes with the archetype:

So we need to...

hohwille commented 3 years ago

autoclosed by PR #403 but PR #404 is still open.