This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch CAUSEWAY-3866 in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 3f4c549a9e8b1413944c3093ffef42afc25b60ad Author: Dan Haywood <[email protected]> AuthorDate: Sat Oct 18 09:16:48 2025 +0100 CAUSEWAY-3866: updates references to javax.inject.Provider --- .../tutorials/modules/petclinic/pages/010-getting-started.adoc | 2 +- .../modules/ROOT/partials/domain-services/inject-services.adoc | 10 +++++----- .../modules/ROOT/partials/domain-services/overriding.adoc | 2 +- .../modules/ROOT/partials/domain-services/progmodel.adoc | 2 +- .../modules/ROOT/partials/domain-services/scoped-services.adoc | 8 ++++---- .../userguide/modules/ROOT/partials/modules/decoupling.adoc | 2 +- .../ROOT/partials/properties-collections-actions/actions.adoc | 2 +- .../partials/properties-collections-actions/properties.adoc | 2 +- .../userguide/modules/ROOT/partials/the-theory/metamodel.adoc | 2 +- testing/adoc/modules/ROOT/pages/about.adoc | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc b/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc index c9fb644b91c..88a9dffa9bf 100644 --- a/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc +++ b/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc @@ -131,7 +131,7 @@ Map these onto the fields of the "simple object" entity, and the action buttons It's common for each entity (or more precisely, aggregate root) to have a corresponding domain service, acting as its repository. This abstraction hides the details of interacting with the persistence data store. -Domain services are automatically injected wherever they are required, using `@javax.inject.Inject`. +Domain services are automatically injected wherever they are required, using `@jakarta.inject.Inject`. Apache Causeway applications therefore generally follow the _hexagonal architecture_ (aka the _ports and adapters_ architecture). diff --git a/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc b/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc index a3147c8f2a1..e0bc5ba3350 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc @@ -11,7 +11,7 @@ Since this is a core capability of Spring, it's worth checking out Spring's link [TIP] ==== -Injection is requested using the JEE link:https://docs.oracle.com/javaee/7/api/javax/inject/Inject.html[@javax.inject.Inject] annotation. +Injection is requested using the JEE `@jakarta.inject.Inject` annotation. This is described in Spring's documentation, link:https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-standard-annotations[using JSR330 standard annotations]. It is also possible to use Spring's own link:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/annotation/Autowired.html[@Autowired] annotation. @@ -93,7 +93,7 @@ For example, setter injection is: [source,java] ---- -import javax.inject.Inject; +import jakarta.inject.Inject; public class Customer { ... @@ -113,7 +113,7 @@ Some of the boilerplate can be removed using Project Lombok: [source,java] ---- -import javax.inject.Inject; +import jakarta.inject.Inject; import lombok.Setter; public class Customer { @@ -128,7 +128,7 @@ If you want to use field injection, then this is simply: [source,java] ---- -import javax.inject.Inject; +import jakarta.inject.Inject; public class Customer { ... @@ -154,7 +154,7 @@ It's also possible to inject a list of services: [source,java] ---- -import javax.inject.Inject; +import jakarta.inject.Inject; public class DocumentService { ... diff --git a/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc b/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc index af3b502ef80..c2dfff88e6c 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc @@ -3,7 +3,7 @@ :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...] :page-partial: -Apache Causeway runs on top of Spring Boot, and relies on Spring Boot for dependency injection using `@javax.inject.Inject`. +Apache Causeway runs on top of Spring Boot, and relies on Spring Boot for dependency injection using `@jakarta.inject.Inject`. The `@jakarta.annotation.Priority` annotation is used to prioritize multiple service implementations. This allows any framework-provided domain service to be replaced by a user-defined one if required, simply by assigning it with an earlier precedence (= higher priority). diff --git a/antora/components/userguide/modules/ROOT/partials/domain-services/progmodel.adoc b/antora/components/userguide/modules/ROOT/partials/domain-services/progmodel.adoc index 3fe7ac735d4..6f61c68aaf0 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-services/progmodel.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-services/progmodel.adoc @@ -11,7 +11,7 @@ Domain services that are visible in the UI or REST API are annotated with xref:r link:https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/stereotype/Service.html[@Service] or link:https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/stereotype/Repository.html[@Repository]. -Once declared, domain services can be injected into other domain objects (*including* entities and view models) using `@javax.inject.Inject`. +Once declared, domain services can be injected into other domain objects (*including* entities and view models) using `@jakarta.inject.Inject`. There's more on this topic xref:domain-services.adoc#injecting-services[below]. === Nature of Service diff --git a/antora/components/userguide/modules/ROOT/partials/domain-services/scoped-services.adoc b/antora/components/userguide/modules/ROOT/partials/domain-services/scoped-services.adoc index 8a9fbbf3434..b1d4c043f33 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-services/scoped-services.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-services/scoped-services.adoc @@ -25,12 +25,12 @@ public class MyService { } ---- -Unlike application-scoped services, these request-scoped services must be injected using a slightly different idiom (borrowed from CDI), using a `javax.inject.Provider`. +Unlike application-scoped services, these request-scoped services must be injected using a slightly different idiom (borrowed from CDI), using a `jakarta.inject.Provider`. For example: [source,java] ---- -import javax.inject.Provider; +import jakarta.inject.Provider; public class SomeClient { ... @@ -50,8 +50,8 @@ To use that service, the idiom would be: [source,java] ---- -import javax.inject.Inject; -import javax.inject.Provider; +import jakarta.inject.Inject; +import jakarta.inject.Provider; public class Customer { ... diff --git a/antora/components/userguide/modules/ROOT/partials/modules/decoupling.adoc b/antora/components/userguide/modules/ROOT/partials/modules/decoupling.adoc index 9f25b1cb581..0bbcef743cc 100644 --- a/antora/components/userguide/modules/ROOT/partials/modules/decoupling.adoc +++ b/antora/components/userguide/modules/ROOT/partials/modules/decoupling.adoc @@ -10,7 +10,7 @@ The key features that Apache Causeway provides to support this are: * dependency injection of services + -Both xref:refguide:applib-svc:about.adoc[framework-defined] domain services and application-defined services (eg repositories and factories) are injected everywhere, using the `@javax.inject.Inject` annotation (Spring's `@Autowired` can also be used). +Both xref:refguide:applib-svc:about.adoc[framework-defined] domain services and application-defined services (eg repositories and factories) are injected everywhere, using the `@jakarta.inject.Inject` annotation (Spring's `@Autowired` can also be used). + By "everywhere", we mean not just into xref:domain-services.adoc[domain services], but _also_ can be injected into xref:domain-entities.adoc[domain entities], xref:view-models.adoc[view models] and xref:mixins.adoc[mixins]. This enables us to implement behaviourally complete domain objects (if we so wish). diff --git a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc index 033bfbfb8b0..1faa755a1b8 100644 --- a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc +++ b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc @@ -82,7 +82,7 @@ public List<Product> autoComplete0AddToBasket( // <.> String searchTerm) { return productRepository.find(searchTerm); // <.> } [email protected] [email protected] ProductRepository productRepository; ---- diff --git a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc index 44e9935fb84..79f1c4a51c3 100644 --- a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc +++ b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc @@ -157,7 +157,7 @@ For example: [source,java] ---- -import javax.inject.Inject; +import jakarta.inject.Inject; import jakarta.persistence.Column; import jakarta.persistence.Transient; import lombok.Getter; diff --git a/antora/components/userguide/modules/ROOT/partials/the-theory/metamodel.adoc b/antora/components/userguide/modules/ROOT/partials/the-theory/metamodel.adoc index 634283fe7da..12bfe1ddf86 100644 --- a/antora/components/userguide/modules/ROOT/partials/the-theory/metamodel.adoc +++ b/antora/components/userguide/modules/ROOT/partials/the-theory/metamodel.adoc @@ -15,7 +15,7 @@ Notably the metamodel is xref:userguide:btb:programming-model.adoc[extensible]; Most of the annotations recognized by the framework are defined by the Apache Causeway framework itself. For example the `@Title` annotation -- which identifies how the framework should derive a human-readable label for each rendered domain object -- is part of the `org.apache.causeway.applib.annotations` package. -However the framework also recognizes certain other JEE annotations such as `@javax.inject.Inject` (used for dependency injection). +However the framework also recognizes certain other JEE annotations such as `@jakarta.inject.Inject` (used for dependency injection). The framework integrates an ORM for persistence, specifically DataNucleus and the JDO API and since version 2.0.0, JPA (Eclipselink) is supported as well. Both JDO and JPA can map to both relational databases and also to various NoSQL objectstores such as MongoDB or Neo4J. diff --git a/testing/adoc/modules/ROOT/pages/about.adoc b/testing/adoc/modules/ROOT/pages/about.adoc index e4f7d1b7b6e..faae915d690 100644 --- a/testing/adoc/modules/ROOT/pages/about.adoc +++ b/testing/adoc/modules/ROOT/pages/about.adoc @@ -80,11 +80,11 @@ Although integration tests re (necessarily) slower than unit tests, they are not Spring Boot will automatically inject dependencies into integration tests and services, and Apache Causeway extends this to also inject services into every domain object (entity or view model). This is most useful when writing unit tests; simply mock out the service and inject into the domain object. -There are a number of syntaxes supported, but the simplest is to use `@javax.inject.Inject` annotation; for example: +There are a number of syntaxes supported, but the simplest is to use `@jakarta.inject.Inject` annotation; for example: [source,java] ---- [email protected] [email protected] CustomerRepository customers; ----
