SAP / olingo-jpa-processor-v4

The JPA Processor fills the gap between Olingo V4 and the database, by providing a mapping between JPA metadata and OData metadata, generating queries and supporting the entity manipulations.
Apache License 2.0
122 stars 76 forks source link

Support for Java 17 #203

Closed kishanp519 closed 7 months ago

kishanp519 commented 1 year ago

Is there any support for Java 17? Attempting to fix vulnerabilities with Spring and it recommends using Spring 3.0.0 (which requires Java 17) but when creating session context, It's no longer able to Autowire EntityManagerFactory or allow the new jakarta.persistence.EntityManagerFactory to be passed into JPAODataSessionContextAccess sessionContext

@Bean
    public JPAODataSessionContextAccess sessionContext(@Autowired EntityManagerFactory entityManagerFactory) {
        logHandler.log(LogType.CONTEXT, "Attempting to create session context...");
        JPAODataSessionContextAccess sessionContext = JPAODataServiceContext.with()
                .setPUnit(properties.getPunit())
                .setEntityManagerFactory(entityManagerFactory)
                .setTypePackage(properties.getRootPackage())
                .setRequestMappingPath(properties.getDbId())
                .setEdmNameBuilder(new NameBuilderConfiguration(properties.getPunit()))
                .build();
        logHandler.log(LogType.CONTEXT, "Session context successfully created.");

        return sessionContext;
    }
wog48 commented 1 year ago

Actually the JPA Processor works with Java 17 as well. The build action always tests lowest supported Java version, currently Java 8, the latest, currently 19 and the latest LTS version, so 17. See https://github.com/SAP/olingo-jpa-processor-v4/blob/main/.github/workflows/build.yml. Currently Jakarta is not supported. There are plans to create a version that bases on Jakarta, but it is not clear when it will be available

davidmalSAP commented 11 months ago

Hi, Seems the apache olingo odata v4 support for Jakarta EE (e.g. jdk17) will happen soon - see https://github.com/apache/olingo-odata4/pull/130

Are there any concrete plans to introduce such changes soon @wog48 ?

For whom is working with Spring boot 2.x (which reach its end of life in 3 months), this change is crucial.

wog48 commented 7 months ago

Sorry for the late reply. As you may have noticed, with version 2.x (currently 2.0.2) Spring 3, and Jakarta EE are supported.

BitsofSid commented 5 months ago

@kishanp519 Hello can You please share a project with ODATA v4 I am currently in the process of upgrading from v2 to v4 i am facing a lot of issues as there is no documentation , with servletregistration and EdmExtensions not being available going on further from Key Predicates to Uri