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 c01d997c6e7ddd51a59182956f84353607f994ac Author: Dan Haywood <[email protected]> AuthorDate: Sat Oct 18 11:09:52 2025 +0100 CAUSEWAY-3866: removes 'JDO' references --- .../services/exceprecog/ExceptionRecognizer.adoc | 2 +- .../ExceptionRecognizer_010-implementation.adoc | 4 +- .../hooks/MetricsService_010-implementation.adoc | 2 +- ...yPersistenceJdoMetaModelRoleAndPermissions.adoc | 16 --- .../refguide/modules/applib-ant/pages/Column.adoc | 12 +- .../petclinic/pages/010-getting-started.adoc | 3 - .../modules/ROOT/partials/_deployment-options.adoc | 5 +- .../modules/ROOT/partials/domain-entities/jpa.adoc | 12 +- .../modules/ROOT/partials/modules/progmodel.adoc | 4 +- .../ROOT/partials/the-theory/metamodel.adoc | 5 +- .../modules/ROOT/partials/view-models/_intro.adoc | 24 +--- antora/supplemental-ui/index.html | 36 +----- .../causeway/applib/annotation/DomainObject.java | 16 +-- .../apache/causeway/applib/annotation/Nature.java | 5 +- .../causeway/applib/annotation/Property.java | 16 +-- .../unrecoverable/RepositoryException.java | 2 +- .../applib/services/bookmark/IdStringifier.java | 13 +- .../services/exceprecog/ExceptionRecognizer.java | 4 +- .../services/exceprecog/RootCauseFinder.java | 1 - .../applib/services/factory/FactoryService.java | 9 +- .../services/iactnlayer/InteractionService.java | 13 +- .../applib/services/repository/EntityState.java | 2 - .../services/repository/RepositoryService.java | 32 ++--- .../src/main/adoc/modules/schema/pages/common.adoc | 5 +- .../section-hooks/causeway.core.config~pre.adoc | 2 +- .../causeway.persistence.schema~pre.adoc | 2 +- .../config/pages/sections/causeway.applib.adoc | 24 ++-- .../causeway.core.meta-model.validator.adoc | 23 +--- .../core/config/CausewayConfiguration.java | 51 +++++--- .../config/beans/CausewayBeanTypeRegistry.java | 18 +-- .../interactions-commands-and-executions.adoc | 1 - .../main/adoc/modules/metamodel/pages/about.adoc | 5 +- .../DomainObjectAnnotationFacetFactory.java | 2 +- .../objectvalue/digits/MaxTotalDigitsFacet.java | 8 +- .../objectlifecycle/ObjectLifecyclePublisher.java | 16 +-- .../session/InteractionServiceDefault.java | 8 +- .../changetracking/EntityChangeTracker.java | 6 +- .../secman/adoc/modules/secman/pages/about.adoc | 2 +- .../adoc/modules/secman/pages/setting-up.adoc | 14 --- ...yPersistenceJpaMetaModelRoleAndPermissions.java | 53 +++++++++ .../scripts/SeedUsersAndRolesFixtureScript.java | 14 ++- mavendeps/adoc/modules/mavendeps/pages/about.adoc | 3 +- .../jpa/eclipselink/src/main/java/module-info.java | 2 + .../CausewayModulePersistenceJpaEclipselink.java | 2 +- .../jpa/eclipselink/app/JpaMetamodelMenu.java | 10 ++ ...xLengthFromJpaColumnAnnotationFacetFactory.java | 3 - .../testdomain/conf/Configuration_usingWicket.java | 17 --- .../testdomain/fixtures/EntityTestFixtures.java | 9 +- .../stubs/ExecutionPublishingTestAbstract.java | 2 - regressiontests/incubating/log4j2-test.xml | 28 +---- retired/scripts/enhance.sh | 131 --------------------- 51 files changed, 245 insertions(+), 454 deletions(-) diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/ExceptionRecognizer.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/ExceptionRecognizer.adoc index a9f4a040c6c..8526b30314c 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/ExceptionRecognizer.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/ExceptionRecognizer.adoc @@ -5,7 +5,7 @@ Domain service to (attempt) to recognize certain exceptions, and return user-fri Rather than redirecting to a general-purpose error page, the message (corresponding to the recognized exception) is rendered as a regular validation message. -For example, a set of recognizers are provided for the JPA and JDO persistence mechanisms in order to recognize and handle SQL constraint exceptions such as uniqueness violations. These can then be rendered back to the user as expected errors, rather than fatal stacktraces. +For example, a set of recognizers are provided for the xref:pjpa:ROOT:about.adoc[JPA/Eclipselink] object store in order to recognize and handle SQL constraint exceptions such as uniqueness violations. These can then be rendered back to the user as expected errors, rather than fatal stacktraces. More than one implementation of xref:refguide:applib:index/services/exceprecog/ExceptionRecognizer.adoc[ExceptionRecognizer] can be registered; they will all be consulted (in the order as specified by Spring's _org.springframework.core.annotation.Order_ annotation) to determine if they recognize the exception. The message returned by the first service recognizing the exception is used. diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/hooks/ExceptionRecognizer_010-implementation.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/hooks/ExceptionRecognizer_010-implementation.adoc index 8fb73490888..78ecbad823f 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/hooks/ExceptionRecognizer_010-implementation.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/services/exceprecog/hooks/ExceptionRecognizer_010-implementation.adoc @@ -5,7 +5,7 @@ == Implementation -The framework provides a number of default implementations for JPA and JDO, to recognise: +The framework provides a number of default implementations for xref:pjpa:ROOT:about.adoc[JPA/Eclipselink], to recognise: * data already exists (uniqueness constraints) * object not found @@ -32,7 +32,7 @@ The following configuration property is relevant: (`false`) |whether any `DataAccessException` exceptions should be recognized.+ -If Spring encounters a data access problem (either JPA or JDO) then it will throw a subclass of `DataAccessException`. +If Spring encounters a data access problem then it will throw a subclass of `DataAccessException`. This recogniser catches this exception class and throws a suitable recognition based on the subtype. diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/metrics/hooks/MetricsService_010-implementation.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/metrics/hooks/MetricsService_010-implementation.adoc index 2376771ad06..9cb0e3505e0 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/services/metrics/hooks/MetricsService_010-implementation.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/services/metrics/hooks/MetricsService_010-implementation.adoc @@ -6,4 +6,4 @@ == Implementation The common persistence module provides a default of this service, namely xref:refguide:persistence:index/commons/integration/changetracking/EntityChangeTrackerDefault.adoc[]. -This supports both JDO and JPA persistence mechanisms. +This is support by the xref:pjpa:ROOT:about.adoc[JPA/Eclipselink] persistence mechanism. diff --git a/antora/components/refguide-index/modules/extensions/pages/index/secman/applib/role/seed/CausewayPersistenceJdoMetaModelRoleAndPermissions.adoc b/antora/components/refguide-index/modules/extensions/pages/index/secman/applib/role/seed/CausewayPersistenceJdoMetaModelRoleAndPermissions.adoc deleted file mode 100644 index a999cb8f7fb..00000000000 --- a/antora/components/refguide-index/modules/extensions/pages/index/secman/applib/role/seed/CausewayPersistenceJdoMetaModelRoleAndPermissions.adoc +++ /dev/null @@ -1,16 +0,0 @@ -= CausewayPersistenceJdoMetaModelRoleAndPermissions -: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 [...] - -Sets up a role with access to the menu actions to download the JDO metamodel. - -== API - -[source,java] -.CausewayPersistenceJdoMetaModelRoleAndPermissions.java ----- -class CausewayPersistenceJdoMetaModelRoleAndPermissions { - public static final String ROLE_NAME; - CausewayPersistenceJdoMetaModelRoleAndPermissions() -} ----- - diff --git a/antora/components/refguide/modules/applib-ant/pages/Column.adoc b/antora/components/refguide/modules/applib-ant/pages/Column.adoc index 01380b0cc7c..aaf2a9d4761 100644 --- a/antora/components/refguide/modules/applib-ant/pages/Column.adoc +++ b/antora/components/refguide/modules/applib-ant/pages/Column.adoc @@ -1,10 +1,8 @@ [#jakarta-persistence-Column] -= @Column (jpa) += @Column (jakarta.persistence) :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 [...] -// TODO: 3866 - to update, this mostly refers to JDO. - The JPA `@jakarta.persistence.Column` provides metadata describing how JPA should persist the property to a database RDBMS table column (or equivalent concept for other persistence stores). Apache Causeway also parses and interprets this annotation in order to build up aspects of its metamodel. @@ -12,7 +10,7 @@ Apache Causeway also parses and interprets this annotation in order to build up [NOTE] ==== Apache Causeway parses the `@Column` annotation from the Java source code; it does not query the JPA metamodel. -This means that it the `@Column` annotation must be used rather than XML metadata.. +This means that it the `@Column` annotation must be used rather than XML metadata. ==== This section identifies which attributes of `@Column` are recognized and used by Apache Causeway. @@ -41,10 +39,10 @@ public class Customer { Causeway also provides xref:refguide:applib:index/annotation/Property.adoc#optionality[@Property#optionality] attribute. If both are specified, Apache Causeway will check when it initializes for any contradictions, and will fail-fast with an appropriate error message in the log if there are. -You should also be aware that in the lack of either the `@Column#nullable` or the `@Property#optionality` attributes, that the JDO and Apache Causeway defaults differ. +You should also be aware that in the lack of either the `@Column#nullable` or the `@Property#optionality` attributes, that the xref:pjpa:ROOT:about.adoc[JPA/Eclipselink] and Apache Causeway defaults differ. Apache Causeway rule is straight-forward: properties are assumed to be required. -JDO on the other hand specifies that only primitive types are mandatory; everything else is assumed to be optional. -Therefore a lack of either annotation can also trigger the fail-fast validation check. +xref:pjpa:ROOT:about.adoc[JPA/Eclipselink] on the other hand properties are assumed to be optional. +A lack of either annotation may result in a metamodel validation error. In the vast majority of cases you should be fine just to add the `@Column#nullable` attribute to the getter. But see the documentation for xref:refguide:applib:index/annotation/Property.adoc#optionality[@Property#optionality] attribute for discussion on one or two minor edge cases. 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 88a9dffa9bf..dca1b526e98 100644 --- a/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc +++ b/antora/components/tutorials/modules/petclinic/pages/010-getting-started.adoc @@ -34,9 +34,6 @@ For this tutorial, also make sure that your IDE is configured to support Lombok. Apache Causeway provides two starter apps, xref:docs:starters:helloworld.adoc[HelloWorld] and xref:docs:starters:simpleapp.adoc[SimpleApp]. These are identical in terms of functionality, but the simpleapp provides more structure and includes example tests. -NOTE: there are JPA and JDO variants of the starter apps. -This tutorial uses JPA as it is the more commonly used persistence mechanism. - We start the tutorial simply with a copy of xref:docs:starters:simpleapp.adoc[SimpleApp]; in subsequent exercises we'll refactor and build upon it to morph it into the petclinic domain. * Clone the repo: diff --git a/antora/components/userguide/modules/ROOT/partials/_deployment-options.adoc b/antora/components/userguide/modules/ROOT/partials/_deployment-options.adoc index 68353ec6c0e..9e64ebd5ec7 100644 --- a/antora/components/userguide/modules/ROOT/partials/_deployment-options.adoc +++ b/antora/components/userguide/modules/ROOT/partials/_deployment-options.adoc @@ -79,11 +79,8 @@ It's therefore relatively easy to take a domain object prototyped and/or tested If you are interested in taking this approach, then you will need to provide your own implementations of any framework-provided services used by your code. -If your own application framework is based on link:https://spring.io/projects/spring-boot[Spring Boot] and with JPA or JDO, then there is another option. +If your own application framework is based on link:https://spring.io/projects/spring-boot[Spring Boot] and using JPA as its ORM, then there is another option. As noted above, Apache Causeway itself runs on top of Spring Boot. You could therefore develop a complete custom UI using one of the regular Spring technologies and run that alongside Apache Causeway - in effect the option described <<deploy-with-custom-controllers,earlier>> but for every use case, not just selected ones. Apache Causeway continues to manage the object lifecycle and persistence as a thin layer on top of Spring, but your custom UI renders the domain objects exactly as you require. - - - diff --git a/antora/components/userguide/modules/ROOT/partials/domain-entities/jpa.adoc b/antora/components/userguide/modules/ROOT/partials/domain-entities/jpa.adoc index c53981d99be..58975cbaf4b 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-entities/jpa.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-entities/jpa.adoc @@ -138,7 +138,7 @@ public class SimpleObject { /* ... */ } ---- <.> There may be several `@NamedQuery` annotations, nested within a `@NamedQueries` annotation) defines queries using JPAQL. <.> Defines the name of the query. -<.> The definition of the query, using JPAQL syntax. +<.> The definition of the query, using JPQL syntax. To actually use the above definition, the framework provides the xref:refguide:applib:index/services/repository/RepositoryService.adoc[RepositoryService]. This is a generic repository for any domain class. @@ -148,10 +148,10 @@ The corresponding repository method for the above query is: [source,java] ---- public List<SimpleObject> findByName(String name) { - return repositoryService.allMatches( // <.> - Query.named(SimpleObject.class, // <.> - "findByNameLike") // <.> - .withParameter("name", name) // <.> + return repositoryService.allMatches( // <.> + Query.named(SimpleObject.class, // <.> + "SimpleObject.findByNameLike") // <.> + .withParameter("name", name) // <.> ); } @@ -160,7 +160,7 @@ public List<SimpleObject> findByName(String name) { <.> find all instances that match the query <.> Specifies the class that is annotated with `@NamedQuery` <.> Corresponds to the `@NamedQuery#name` attribute -<.> Corresponds to the `:name` parameter in the query JDOQL string +<.> Corresponds to the `:name` parameter in the query JPQL string diff --git a/antora/components/userguide/modules/ROOT/partials/modules/progmodel.adoc b/antora/components/userguide/modules/ROOT/partials/modules/progmodel.adoc index ba5ecf031c6..0547b45dafd 100644 --- a/antora/components/userguide/modules/ROOT/partials/modules/progmodel.adoc +++ b/antora/components/userguide/modules/ROOT/partials/modules/progmodel.adoc @@ -58,7 +58,7 @@ We can therefore rely on Maven to ensure there are no cyclic dependencies: the a [NOTE] ==== -If the above convention is too officious, then you could choose to have multiple Spring modules per Maven module, but you will need to watch out for cycles. +You could instead choose to have multiple Spring modules per Maven module, but if so you will need to watch out for cycles. In such cases (proprietary) tools such as link:https://structure101.com/[Structure 101] can be used to help detect and visualize such cycles. Or, (open source) libraries such as link:https://www.archunit.org/[ArchUnit] or https://jqassistant.org/[jQAssistant] can help enforce architectural layering to prevent the issue arising in the first place. @@ -94,7 +94,7 @@ public class CausewayModuleExtExcelApplib { } ---- <.> the link:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/ComponentScan.html[@ComponentScan] indicates that the classpath should be scanned for domain services, entities and xref:testing:fixtures:about.adoc[fixture scripts]. -<.> recommended if using xref:pjpa::about.adoc[JPA/EclipseLink], skip if using JDO. +<.> recommended if using xref:pjpa::about.adoc[JPA/EclipseLink]. When there is a dependency, this is then expressed in two ways: first, as a "physical" `<dependency>` in Maven; and second, as a "logical" dependency using link:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Import.html[@Import] in the `@Configuration` module. 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 12bfe1ddf86..cd37cfcadbf 100644 --- a/antora/components/userguide/modules/ROOT/partials/the-theory/metamodel.adoc +++ b/antora/components/userguide/modules/ROOT/partials/the-theory/metamodel.adoc @@ -17,9 +17,8 @@ Most of the annotations recognized by the framework are defined by the Apache Ca 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 `@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. -Apache Causeway recognizes a number of these persistence-specific annotations, for example `@jakarta.persistence.Column(nullable=...)`. +The framework integrates with xref:pjpa:ROOT:about.adoc[JPA/Eclipselink] for persistence. +Apache Causeway recognizes a number of its persistence-specific annotations, for example `@jakarta.persistence.Column(nullable=...)`. In addition, the framework builds up the metamodel for each domain object using xref:userguide:ROOT:ui-layout-and-hints.adoc#object-layout[layout hints], such as `Customer.layout.xml`. These provide metadata such as grouping elements of the UI together, using multi-column layouts, and so on. diff --git a/antora/components/userguide/modules/ROOT/partials/view-models/_intro.adoc b/antora/components/userguide/modules/ROOT/partials/view-models/_intro.adoc index 97961e598f9..b565f7a3285 100644 --- a/antora/components/userguide/modules/ROOT/partials/view-models/_intro.adoc +++ b/antora/components/userguide/modules/ROOT/partials/view-models/_intro.adoc @@ -68,31 +68,19 @@ It is not a persisted entity, instead it belongs to the application layer. == Self-persisting Domain entities -Sometimes we may have domain entities whose persistence is _not_ managed by JDO or JPA mechanism, in other words they take responsibility for their own persistence. -Because such entities are responsible for their own state management, they can be implemented as view models. +Sometimes we may have domain objects that conceptually are entities - long-lived persistent and shared instances - but where the state is not stored in an accessible RDBMS. +For example: -=== Externally-managed entities +* The entity might be externally-managed, and reside in some other system, for example accessible only through a SOAP web service. -Sometimes the entities that make up your application are persisted not in the local database but reside in some other system, for example accessible only through a SOAP web service. -Logically that data might still be considered a domain entity and we might want to associate behaviour with it, however it cannot be modelled as a domain entity since JPA/EclipseLink doesn't know about the entity nor how to retrieve or update it. +* The entity's state might reside in a datastore not supported by xref:pjpa:ROOT:about.adoc[JPA/Eclipselink], such as a graph database like neo4j. -There are a couple of ways around this: we could either replicate the data somehow from the external system into the Causeway-managed database (in which case it is once again just another domain entity), or we could set up a stub/proxy for the externally managed entity. -This proxy would hold the reference to the externally-managed domain entity (eg an external id), as well as the "smarts" to know how to interact with that entity (by making SOAP web service calls etc). +* the entity's state might be held only in-memory, for example read-only configuration data that is read from a config file (eg log4j appender definitions). -The stub/proxy is a type of view model: a view -- if you like -- onto the domain entity managed by the external system. +Because such entities are responsible for their own state management, they should be implemented within Causeway as view models, for example by implementing the xref:refguide:applib:index/ViewModel.adoc[] interface. -=== Internal entities - -Alternatively, perhaps your application has an entity that is best persisted not in a relational database but instead in a custom datastore, for example a graph database such as neo4j. - -=== In-memory entities - -As a variation on the above, sometimes there are domain objects that are, conceptually at least entities, but whose state is not actually persisted anywhere, merely held in-memory (eg in a hash). - -A simple example is read-only configuration data that is read from a config file (eg log4j appender definitions) but thereafter is presented in the UI just like any other entity. - == DTOs DTOs (data transfer objects) are simple classes that (according to link:https://en.wikipedia.org/wiki/Data_transfer_object[wikipedia]) "carry data between processes". diff --git a/antora/supplemental-ui/index.html b/antora/supplemental-ui/index.html index fca520eb5d7..b6e32bfbc2f 100644 --- a/antora/supplemental-ui/index.html +++ b/antora/supplemental-ui/index.html @@ -592,10 +592,10 @@ <h4 class="cta-text">Try out ...</h4> docker run -p 8080:8080 apache/causeway-app-helloworld:latest</pre> <p> <p class="cta-text text-left" style="margin-block-end: 0; "> - Build from source (JPA or JDO) using: + Build from source using: <pre id="helloworld-jpa-text"> APP=causeway-app-helloworld -VARIANT="3-jpa" # or: "3-jdo" +VARIANT="3-jpa" curl https://codeload.github.com/apache/$APP/zip/v$VARIANT | jar xv cd $APP-$VARIANT @@ -613,10 +613,10 @@ <h4 class="cta-text">Develop your own ...</h4> docker run -p 8080:8080 apache/causeway-app-simpleapp:latest</pre> <p> <p class="cta-text text-left" style="margin-block-end: 0; "> - Build from source (JPA or JDO) using: + Build from source using: <pre id="simpleapp-jpa-text"> APP=causeway-app-simpleapp -VARIANT="3-jpa" # or: "3-jdo" +VARIANT="3-jpa" curl https://codeload.github.com/apache/$APP/zip/v$VARIANT | jar xv cd $APP-$VARIANT @@ -634,7 +634,7 @@ <h4 class="cta-text" style="margin-top: 20px">Learn and Explore...</h4> <br/> <p class="cta-text text-left" style="margin-block-end: 0; "> <pre id="demoapp-docker-text" style="margin-top: 5px"> -docker run -p 8080:8080 apache/causeway-app-demo-jpa:latest # or: ...-jdo:latest</pre> +docker run -p 8080:8080 apache/causeway-app-demo-jpa:latest</pre> <br/> <p> </div> @@ -748,19 +748,6 @@ <h3>Help</h3> <script src="_/js/home/lib/sticky/sticky.js"></script> <script> - document.querySelector('#helloworld-jdo-copy').addEventListener('click', async event => { - if (!navigator.clipboard) { - document.querySelector('#helloworld-jdo-copy').remove(); - return - } - const text = document.querySelector('#helloworld-jdo-text').innerHTML; - try { - await navigator.clipboard.writeText(text); - event.target.textContent = 'Copied to clipboard'; - } catch (err) { - alert("Failed to copy :-(", err) - } - }); document.querySelector('#helloworld-jpa-copy').addEventListener('click', async event => { if (!navigator.clipboard) { document.querySelector('#helloworld-jpa-copy').remove(); @@ -774,19 +761,6 @@ <h3>Help</h3> alert("Failed to copy :-(", err) } }); - document.querySelector('#simpleapp-jdo-copy').addEventListener('click', async event => { - if (!navigator.clipboard) { - document.querySelector('#simpleapp-jdo-copy').remove(); - return - } - const text = document.querySelector('#simpleapp-jdo-text').innerHTML; - try { - await navigator.clipboard.writeText(text); - event.target.textContent = 'Copied to clipboard'; - } catch (err) { - alert("Failed to copy :-(", err) - } - }) document.querySelector('#simpleapp-jpa-copy').addEventListener('click', async event => { if (!navigator.clipboard) { document.querySelector('#simpleapp-jpa-copy').remove(); diff --git a/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java b/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java index 182685897d5..8d6ef24be99 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java @@ -442,8 +442,8 @@ Nature nature() * Fine-tunes how auto-complete queries work, Whether to use the value of this (string) property for auto. * * <p> - * NOTE: this feature requires that the <code>querydsl-xxx</code> module (for JDO or JPA as required) is - * included as part of the application manifest. Otherwise, no autocomplete will be generated. + * NOTE: this feature requires that the <code>querydsl-jpa</code> module is included as part of the + * application manifest. Otherwise, no autocomplete will be generated. * </p> * * <p> @@ -468,8 +468,8 @@ Nature nature() * </p> * * <p> - * NOTE: this feature requires that the <code>querydsl-xxx</code> module (for JDO or JPA as required) is - * included as part of the application manifest. Otherwise, no autocomplete will be generated. + * NOTE: this feature requires that the <code>querydsl-jpa</code> module is included as part of the + * application manifest. Otherwise, no autocomplete will be generated. * </p> * * @see #queryDslAutoCompleteMinLength() @@ -492,8 +492,8 @@ Nature nature() * </p> * * <p> - * NOTE: this feature requires that the <code>querydsl-xxx</code> module (for JDO or JPA as required) is - * included as part of the application manifest. Otherwise, no autocomplete will be generated. + * NOTE: this feature requires that the <code>querydsl-jpa</code> module is included as part of the + * application manifest. Otherwise, no autocomplete will be generated. * </p> * * @see #queryDslAutoCompleteAdditionalPredicateMethod() @@ -509,8 +509,8 @@ Nature nature() * added to the autocomplete (for example to search only for current or active objects). * * <p> - * NOTE: this feature requires that the <code>querydsl-xxx</code> module (for JDO or JPA as required) is - * included as part of the application manifest. Otherwise, no autocomplete will be generated. + * NOTE: this feature requires that the <code>querydsl-jpa</code> module is included as part of the + * application manifest. Otherwise, no autocomplete will be generated. * </p> * * @see #queryDslAutoCompleteMinLength() diff --git a/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java b/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java index a6f6008ab53..e59dc27ad98 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java @@ -39,8 +39,9 @@ public enum Nature { NOT_SPECIFIED, /** - * A domain entity whose persistence is managed internally by Causeway, - * using JPA or JDO as the persistence implementation. + * A domain entity whose persistence is managed by Causeway using the configured object store, + * eg JPA/EclipseLink. + * * <p> * Domain entities are considered to be part of the domain model layer. * <p> diff --git a/api/applib/src/main/java/org/apache/causeway/applib/annotation/Property.java b/api/applib/src/main/java/org/apache/causeway/applib/annotation/Property.java index 3c1f8db31dc..4a61ac98b8b 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/annotation/Property.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/annotation/Property.java @@ -24,6 +24,8 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import jakarta.persistence.Column; + import org.springframework.core.annotation.AliasFor; import org.apache.causeway.applib.events.domain.PropertyDomainEvent; @@ -199,9 +201,9 @@ String fileAccept() * </p> * * <p> - * NOTE: this will usually be supplemented by a JDO or JPA-specific - * annotation to indicate length of the column in the table to whic - * the entity is mapped. + * NOTE: if using the JPA object store, the field will usually also be annotated using + * {@link Column#length()} to specify the length of the column in the table to which the + * entity is mapped. * </p> * * @see Parameter#maxLength() @@ -236,8 +238,8 @@ Class<? extends Specification>[] mustSatisfy() * Whether this property is optional or is mandatory (ie required). * * <p> - * NOTE: this will usually be supplmented by a JDO or JPA-specific - * annotation to specify the nullability of the corresponding column in + * NOTE: if using the JPA object store, the field will usually also be annotated using + * {@link Column#nullable()} to specify the nullability of the corresponding column in * the table to which the owning entity is mapped. * </p> * @@ -354,8 +356,8 @@ public boolean isIgnoreCase() { * </p> * * <p> - * NOTE: this feature requires that the <code>querydsl-xxx</code> module (for JDO or JPA as required) is - * included as part of the application manifest. Otherwise, no autocomplete will be generated. + * NOTE: this feature requires that the <code>querydsl-jpa</code> module is included as part of the + * application manifest. Otherwise, no autocomplete will be generated. * </p> * * <p> diff --git a/api/applib/src/main/java/org/apache/causeway/applib/exceptions/unrecoverable/RepositoryException.java b/api/applib/src/main/java/org/apache/causeway/applib/exceptions/unrecoverable/RepositoryException.java index 0c37cd6c108..350e04de1da 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/exceptions/unrecoverable/RepositoryException.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/exceptions/unrecoverable/RepositoryException.java @@ -26,7 +26,7 @@ * * <p> * This exception is intended to represent an unexpected and non-recoverable condition (eg a syntax error in some - * JDOQL query syntax or similar), and so is a subclass of {@link UnrecoverableException}. + * named query syntax, or similar), and so is a subclass of {@link UnrecoverableException}. * Throwing this exception will therefore result in (some sort of) error page being displayed * to the user. * diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/bookmark/IdStringifier.java b/api/applib/src/main/java/org/apache/causeway/applib/services/bookmark/IdStringifier.java index 7fb7b34c1ba..715c19fe02e 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/services/bookmark/IdStringifier.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/services/bookmark/IdStringifier.java @@ -24,8 +24,7 @@ /** * SPI to convert the identifier (primary key) of an entity, of a given type (eg Integer) into a string, and - * to convert back again into the key object used to actually look up the target entity instance; - * supported by both JDO and JPA persistence mechanisms. + * to convert back again into the key object used to actually look up the target entity instance. * * <p> * This is ultimately used by {@link BookmarkService} where we hold a persistent reference to an entity. The @@ -34,9 +33,9 @@ * </p> * * <p> - * The framework provides default implementations of this SPI for JDO (data store and application identity) and - * for JPA. Because this is a SPI, other modules or application code can provide their own implementations. - * An example of such is the JPA implementation of the <code>commandlog</code> extension. + * The framework provides default implementations of this SPI for the supported value types. Modules that define + * application-defined primary keys can provide their own implementations of this SPI, for examples see the + * JPA entities defined in the commandlog-jpa module. * </p> * * @since 2.0 {@index} @@ -59,9 +58,7 @@ public interface IdStringifier<T> { * Convert a string representation of the identifier (as returned by {@link #enstring(Object)}) into an object * that can be used to retrieve. * - * @param targetEntityClass - the class of the target entity, eg <code>Customer</code>. For both JDO and JPA, - * we always have this information available, and is needed (at least) by the JDO - * implementations of application primary keys using built-ins, eg <code>LongIdentity</code>. + * @param targetEntityClass - the class of the target entity, eg <code>Customer</code>. * @param stringified - as returned by {@link #enstring(Object)} */ T destring(@NonNull Class<?> targetEntityClass, @NonNull String stringified); diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/ExceptionRecognizer.java b/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/ExceptionRecognizer.java index 5ec046d917b..6a9fe935e42 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/ExceptionRecognizer.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/ExceptionRecognizer.java @@ -30,8 +30,8 @@ * as a regular validation message. * * <p> - * For example, a set of recognizers are provided for the JPA and JDO - * persistence mechanisms in order to recognize and handle SQL constraint + * For example, a set of recognizers are provided for the JPA + * object store in order to recognize and handle SQL constraint * exceptions such as uniqueness violations. These can then be rendered back to * the user as expected errors, rather than fatal stacktraces. * diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/RootCauseFinder.java b/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/RootCauseFinder.java index ef888709917..caa32eb8399 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/RootCauseFinder.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/services/exceprecog/RootCauseFinder.java @@ -25,7 +25,6 @@ * SPI to help {@link Exception} root cause finding. * <p> * Either returns a more specific {@link Throwable} or an {@link Optional#empty()}. - * @apiNote Specifically introduced to handle JDOException's {@code Throwable[] nested}. * * @since 2.0 {@index} */ diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/factory/FactoryService.java b/api/applib/src/main/java/org/apache/causeway/applib/services/factory/FactoryService.java index bdadfe552c2..92560c33059 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/services/factory/FactoryService.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/services/factory/FactoryService.java @@ -92,7 +92,8 @@ public interface FactoryService { /** * Creates a new detached entity instance, with injection points resolved. * <p> - * The entity will not yet be persisted, in other words: its not yet known to the persistence layer. + * The entity will not yet be persisted, in other words: it is not yet known to the persistence layer. + * </p> * * @param <T> * @param entity - most likely just new-ed up, without injection points resolved @@ -164,10 +165,10 @@ default <T> T viewModel(final @NonNull Class<T> viewModelClass) { * @since 2.0 */ <T> T create(@NonNull Class<T> domainClass); - + /** - * In support of built-in tree semantics, as inferred from - * {@link PropertyLayout#navigableSubtree()} or + * In support of built-in tree semantics, as inferred from + * {@link PropertyLayout#navigableSubtree()} or * {@link CollectionLayout#navigableSubtree()} annotations. * @since 3.2 */ diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/iactnlayer/InteractionService.java b/api/applib/src/main/java/org/apache/causeway/applib/services/iactnlayer/InteractionService.java index d8acc0599b0..d133392bb42 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/services/iactnlayer/InteractionService.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/services/iactnlayer/InteractionService.java @@ -26,8 +26,12 @@ import org.jspecify.annotations.NonNull; /** - * A low-level service to programmatically "connect" (or create a - * session, or interact with; choose your term) the framework's runtime. + * A low-level service to programmatically create a short-lived interaction or session. + * + * <p> + * You could think of this as analogous to an {@link java.net.http.HttpRequest} or + * a JPA {@link jakarta.persistence.EntityManager} or a Hibernate Session. + * </p> * * <p> * This service is used internally by the framework itself, for example @@ -37,11 +41,6 @@ * </p> * * <p> - * You could think of this as analogous to an <code>HttpRequest</code>, or - * a JPA <code>EntityManager</code> or JDO <code>PersistenceManager</code>. - * </p> - * - * <p> * There are two main APIs exposed. One is to * {@link #openInteraction(InteractionContext) open} a new {@link InteractionLayer}, * to be {@link #closeInteractionLayers() closed later}. The other is to diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/repository/EntityState.java b/api/applib/src/main/java/org/apache/causeway/applib/services/repository/EntityState.java index 174ecd1b68d..98ad9a1cdf8 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/services/repository/EntityState.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/services/repository/EntityState.java @@ -57,8 +57,6 @@ public enum EntityState { ATTACHED_NO_OID(false), /** * Is detached, hence (per definition) has an OID. - * <p> - * Supported by both JDO and JPA. However, historically never used by the framework for JDO. */ DETACHED(true), /** diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java b/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java index 2c58080a176..aa8cc30c37b 100644 --- a/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java +++ b/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java @@ -60,19 +60,12 @@ public interface RepositoryService { EntityState getEntityState(@Nullable Object object); /** - * Usually called as a precursor to persisting a domain entity, this method - * verifies that the object is an entity and injects domain services into - * it. + * Creates a new detached entity instance, with injection points resolved. * * <p> - * This approach allows the domain entity to have regular constructor - * (with parameters) to set up the initial state of the domain object. - * This is preferred over {@link #detachedEntity(Class)}, which - * also instantiates the class and then injects into it - but requires - * that the domain object has a no-arg constructor to do so. + * The entity will not yet be persisted, in other words: it is not yet known to the persistence layer. * </p> * - * * <p> * This is the same functionality as exposed by * {@link org.apache.causeway.applib.services.factory.FactoryService#detachedEntity(Object)}. @@ -277,10 +270,9 @@ <T> List<T> allMatches( * multiple instances, where a * {@link org.apache.causeway.applib.query.NamedQuery} can be passed in * that ultimately describes a SELECT query with WHERE predicates. - * The mechanism by which this is defined depends on the ORM (JDO or - * JPA). A {@link org.apache.causeway.applib.query.NamedQuery} can - * optionally specify a - * {@link org.apache.causeway.applib.query.NamedQuery#withRange(QueryRange) range} of instances to be returned. + * A {@link org.apache.causeway.applib.query.NamedQuery} can optionally specify a + * {@link org.apache.causeway.applib.query.NamedQuery#withRange(QueryRange) range} + * of instances to be returned. * </p> * * <p> @@ -335,10 +327,9 @@ <T> Optional<T> uniqueMatch( * no more than one instance, where a * {@link org.apache.causeway.applib.query.NamedQuery} can be passed in * that ultimately describes a SELECT query with WHERE predicates. - * The mechanism by which this is defined depends on the ORM (JDO or - * JPA). A {@link org.apache.causeway.applib.query.NamedQuery} can - * optionally specify a - * {@link org.apache.causeway.applib.query.NamedQuery#withRange(QueryRange) range} of instances to be returned. + * A {@link org.apache.causeway.applib.query.NamedQuery} can optionally specify a + * {@link org.apache.causeway.applib.query.NamedQuery#withRange(QueryRange) range} + * of instances to be returned. * </p> * * <p> @@ -386,10 +377,9 @@ <T> Optional<T> firstMatch( * the first matching instance, where a * {@link org.apache.causeway.applib.query.NamedQuery} can be passed in * that ultimately describes a SELECT query with WHERE predicates. - * The mechanism by which this is defined depends on the ORM (JDO or - * JPA). A {@link org.apache.causeway.applib.query.NamedQuery} can - * optionally specify a - * {@link org.apache.causeway.applib.query.NamedQuery#withRange(QueryRange) range} of instances to be returned. + * A {@link org.apache.causeway.applib.query.NamedQuery} can optionally specify a + * {@link org.apache.causeway.applib.query.NamedQuery#withRange(QueryRange) range} + * of instances to be returned. * </p> * * <p> diff --git a/api/schema/src/main/adoc/modules/schema/pages/common.adoc b/api/schema/src/main/adoc/modules/schema/pages/common.adoc index 954894b050e..cae72e7f14e 100644 --- a/api/schema/src/main/adoc/modules/schema/pages/common.adoc +++ b/api/schema/src/main/adoc/modules/schema/pages/common.adoc @@ -52,9 +52,8 @@ The `oidDto` complex type is defined as: Although URIs are not the same as URLs, you will find that the schemas are also downloadable from this location. <.> the `oidDto` complex type defines the unique identifier for any domain object: its type, and an identifier. The `objectState` attribute can usually be omitted (indicating a persistent object) -<.> the object type, corresponding to either the xref:refguide:applib:index/annotation/DomainObject.adoc#logicalTypeName[@DomainObject#logicalTypeName()] attribute, or to the (JDO) -xref:refguide:applib-ant:PersistenceCapable.adoc[@PersistenceCapable] annotation (`schema` and/or `table` attributes), or to the (JDO) xref:refguide:applib-ant:Discriminator.adoc[@Discriminator] annotation. -If none is specified, then the fully qualified class name will be used. +<.> the logical object type name, corresponding to `jakarta.inject.Named` annotation. +If not specified, then the fully qualified class name will be used. <.> the object identifier (aka primary key), converted to string form. <.> the `bookmarkObjectState` enumerates the possible persistence states of the referenced object. In previous versions of the schema the attribute was defaulted to "persistent"; the "persistent" state is assumed if the attribute is omitted. diff --git a/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.core.config~pre.adoc b/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.core.config~pre.adoc index c31f00de1a2..7cecac15852 100644 --- a/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.core.config~pre.adoc +++ b/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.core.config~pre.adoc @@ -1,5 +1,5 @@ :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 [...] -Configuration of the DataNucleus JDO persistence component (the Apache Causeway component that wraps the DataNucleus ORM). +Configuration of the Core framework. diff --git a/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.persistence.schema~pre.adoc b/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.persistence.schema~pre.adoc index ce0c7df37d7..a95a1a72286 100644 --- a/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.persistence.schema~pre.adoc +++ b/core/config/src/main/adoc/modules/config/pages/section-hooks/causeway.persistence.schema~pre.adoc @@ -1,4 +1,4 @@ :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 [...] -Configuration that applies to database persistence schema (used by JPA and JDO datastores). +Configuration that applies to database persistence schema (used by JPA object store). diff --git a/core/config/src/main/adoc/modules/config/pages/sections/causeway.applib.adoc b/core/config/src/main/adoc/modules/config/pages/sections/causeway.applib.adoc index 918d3dd599a..c52f0637a40 100644 --- a/core/config/src/main/adoc/modules/config/pages/sections/causeway.applib.adoc +++ b/core/config/src/main/adoc/modules/config/pages/sections/causeway.applib.adoc @@ -112,7 +112,7 @@ causeway.applib.annotation. + action-layout.css-class-fa. + patterns-as-map -| +| | null @@ -146,7 +146,7 @@ causeway.applib.annotation. + action-layout.css-class. + patterns-as-map -| +| | null @@ -219,7 +219,7 @@ causeway.applib.annotation. + collection-layout. + sequence-policy-if-unreferenced -| +| | How `CollectionLayout#sequence()` should be handled when calculating the slot-in order for unreferenced _Collections_. ++{++@code AS++_++PER++_++SEQUENCE} will use Dewey order based on available 'sequence' attributes, whereas ++{++@code ALPHABETICALLY} will use alphabetical order based on member names. default: ++{++@code AS++_++PER++_++SEQUENCE} @@ -230,7 +230,7 @@ default: ++{++@code AS++_++PER++_++SEQUENCE} causeway.applib.annotation. + collection-layout.table-decorator -| +| | Defines whether the table representation of a collection should be decorated using a client-side Javascript library, eg for client-side paging and filtering. @@ -259,7 +259,7 @@ domain-object-layout. + css-class-ui-event. + post-for-default -| +| | Influences whether an `CssClassUiEvent` should be published (on the internal `EventBusService`) whenever a domain object is about to be rendered in the UI - thereby allowing subscribers to optionally `CssClassUiEvent#setCssClass(String)` change) the CSS classes that are used. The algorithm for determining whether (and what type of) an event is sent depends on the value of the `DomainObjectLayout#cssClassUiEvent()` @DomainObjectLayout(cssClassEvent=...)} for the domain object in question. @@ -277,7 +277,7 @@ causeway.applib.annotation. + domain-object-layout.icon-ui-event. + post-for-default -| +| | Influences whether an `IconUiEvent` should be published (on the internal `EventBusService`) whenever a domain object is about to be rendered in the UI - thereby allowing subscribers to optionally `IconUiEvent#setIconName(String)` change) the icon that is used. The algorithm for determining whether (and what type of) an event is sent depends on the value of the `DomainObjectLayout#iconUiEvent()` @DomainObjectLayout(iconEvent=...)} for the domain object in question. @@ -295,7 +295,7 @@ causeway.applib.annotation. + domain-object-layout. + layout-ui-event.post-for-default -| +| | Influences whether an `LayoutUiEvent` should be published (on the internal `EventBusService`) whenever a domain object is about to be rendered in the UI - thereby allowing subscribers to optionally `LayoutUiEvent#setLayout(String)` change) the layout that is used. If a different layout value has been set, then a layout in the form `xml` use used (where `zzz` is the name of the layout). @@ -326,7 +326,7 @@ causeway.applib.annotation. + domain-object-layout. + table-decorator -| +| | Defines whether the table representation of a standalone collection of this domain class should be decorated using a client-side Javascript library, eg for client-side paging and filtering. @@ -336,7 +336,7 @@ causeway.applib.annotation. + domain-object-layout. + title-ui-event.post-for-default -| +| | Influences whether an `TitleUiEvent` should be published (on the internal `EventBusService`) whenever a domain object is about to be rendered in the UI - thereby allowing subscribers to optionally `TitleUiEvent#setTitle(String)` change) the title that is used. The algorithm for determining whether (and what type of) an event is sent depends on the value of the `DomainObjectLayout#titleUiEvent()` @DomainObjectLayout(titleEvent=...)} for the domain object in question. @@ -465,7 +465,7 @@ The algorithm for determining whether (and what type of) an event is sent depend Note: this applies only to domain entities, not to view models. -Note: There is no corresponding `removed` callback, because (for the JDO persistence store at least) it is not possible to interact with a domain entity once it has been deleted. +Note: There is no corresponding `removed` callback, because it is not possible to interact with a domain entity once it has been deleted. | @@ -550,7 +550,7 @@ causeway.applib.annotation. + property-layout. + sequence-policy-if-unreferenced -| +| | How `PropertyLayout#sequence()` should be handled when calculating the slot-in order for unreferenced _Properties_. ++{++@code AS++_++PER++_++SEQUENCE} will use Dewey order based on available 'sequence' attributes, whereas ++{++@code ALPHABETICALLY} will use alphabetical order based on member names. default: ++{++@code AS++_++PER++_++SEQUENCE} @@ -671,7 +671,7 @@ causeway.applib.annotation. + view-model.validation. + semantic-checking.enable -| +| | Whether to check for inconsistencies between the usage of `DomainObject` and `DomainObjectLayout`. diff --git a/core/config/src/main/adoc/modules/config/pages/sections/causeway.core.meta-model.validator.adoc b/core/config/src/main/adoc/modules/config/pages/sections/causeway.core.meta-model.validator.adoc index 7b7ecbcc487..d554a327646 100644 --- a/core/config/src/main/adoc/modules/config/pages/sections/causeway.core.meta-model.validator.adoc +++ b/core/config/src/main/adoc/modules/config/pages/sections/causeway.core.meta-model.validator.adoc @@ -39,7 +39,7 @@ Note that this settings has no effect if the programming model has been configur causeway.core.meta-model.validator. + allow-logical-type-name-as-alias -| +| | Allows logical type name in `Named` also be included in the list of `DomainObject#aliased()` or `DomainService#aliased()`. It is _highly advisable_ to leave this disabled. This option is meant as a practical way to enable to transition from old names to new logical type names. Especially when you have a large number of files that have to migrated and you want to do the migration in incremental steps. @@ -50,7 +50,7 @@ It is _highly advisable_ to leave this disabled. This option is meant as a pract causeway.core.meta-model.validator. + explicit-logical-type-names -| +| | Whether to ensure that the logical-type-name of all objects must be specified explicitly, using either `Named`. It is _highly advisable_ to leave this set as enabled (the default). These logical-type-names should also (of course) be unique - among non-abstract types. @@ -71,7 +71,7 @@ date-time-type-adapter causeway.core.meta-model.validator. + jaxb-view-model.no-arg-constructor -| +| | If set, then ensures that all JAXB-style view models have a no-arg constructor. @@ -103,23 +103,6 @@ reference-type-adapter | If set, then ensures that for all properties of JAXB-style view models where the property's type is an entity, then that entity's type has been correctly annotated with @`XmlJavaTypeAdapter` (so that the property's value can be converted into a serializable form). -| -[[causeway.core.meta-model.validator.jdoql.from-clause]] -causeway.core.meta-model.validator. + -jdoql.from-clause - -| true -| If set, then ensures that the 'FROM' clause within any JDOQL `@Query`s annotations relates to a known entity type, and moreover that that type is compatible with the type on which the annotation appears: meaning its either a supertype of or the same type as the annotated type. - - -| -[[causeway.core.meta-model.validator.jdoql.variables-clause]] -causeway.core.meta-model.validator. + -jdoql.variables-clause - -| true -| If set, then ensures that the 'VARIABLES' clause within any JDOQL `@Query`s relates to a known entity type. - | [[causeway.core.meta-model.validator.parallelize]] diff --git a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java index 9fd259bfb3c..96451e1b715 100644 --- a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java +++ b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java @@ -653,8 +653,7 @@ public record RemovingLifecycleEvent( * * * <p> - * Note: There is no corresponding <code>removed</code> callback, because (for the JDO persistence store at least) - * it is not possible to interact with a domain entity once it has been deleted. + * Note: There is no corresponding <code>removed</code> callback, because it is not possible to interact with a domain entity once it has been deleted. * */ @DefaultValue("true") @@ -2026,13 +2025,13 @@ public record EntityChangeTracker( * <p> * However, this auto-flush behaviour can be troublesome if the query occurs as a side-effect of the evaluation of a derived property, * whose value in turn is enlisted by an implementation of a subscriber (in particular {@link EntityPropertyChangeSubscriber}) which - * captures the value of all properties (both persisted and derived). However, this behaviour can (at least under JDO), result in a {@link java.util.ConcurrentModificationException}. - * + * captures the value of all properties (both persisted and derived). However, this behaviour may result in a {@link java.util.ConcurrentModificationException}. + * </p> * * <p> * By default, {@link EntityChangeTracker} will therefore temporarily suppress any auto-flushing while this is ongoing. The purpose * of this configuration property is to never suppress, ie always autoflush. - * + * </p> */ @DefaultValue("true") boolean suppressAutoFlush, @@ -2041,6 +2040,7 @@ public record EntityChangeTracker( * * <p> * By default this service is enabled (if added to the classpath as a module). + * </p> * */ @DefaultValue("true") @@ -2066,7 +2066,6 @@ public record Schema( * Does lookup additional "mapping-files" in META-INF/orm-<i>name</i>.xml * (equivalent to "mapping-file" entries in persistence.xml) and adds these * to those that are already configured the <i>Spring Data</i> way (if any). - * @implNote not implemented for JDO */ @DefaultValue List<String> additionalOrmFiles, @@ -3336,20 +3335,26 @@ public record BigDecimal( /** * Indicates how to derive the min fractional facet (the minimum number of digits after the decimal point). * - * <p>If this flag is set, then the {@link Digits#fraction()} annotation or ORM equivalent (the JDO - * <code>@Column#scale</code> or the JPA {@link Column#scale()}) should be used for the + * <p>If this flag is set, then the {@link Digits#fraction()} annotation or the JPA equivalent {@link Column#scale()}) should be used for the * <code>MinFractionalFacet</code> as well as the <code>MaxFractionalFacet</code>. + * </p> * - * <p>What this means in practice is that a numeric values will be rendered to the same number of fractional + * <p> + * What this means in practice is that a numeric values will be rendered to the same number of fractional * digits, irrespective of whether they are whole numbers or fractional. For example, with a scale of 2, * then '123.4532' will be rendered as '123.45', while '123' will be rendered * as '123.00'. + * </p> * - * <p>If this flag is NOT set, or if it is set but there is no annotation, then the {@link Display#minScale} config + * <p> + *If this flag is NOT set, or if it is set but there is no annotation, then the {@link Display#minScale} config * property is used as a fallback. + * </p> * - * <p>If there is no fallback, then it means that a big decimal such as '123.00' will be presented as + * <p> + * If there is no fallback, then it means that a big decimal such as '123.00' will be presented as * just '123' (that is, the shortest possible textual representation). + * </p> */ @DefaultValue("true") boolean useScaleForMinFractionalFacet, @@ -3366,17 +3371,25 @@ public record Editing( * ',' (comma) is the grouping (thousands) separator while the '.' (period) acts as a * decimal point, but in others (eg France, Italy) it is the other way around. * - * <p>Surprisingly perhaps, a string such as "123,99", when parsed ((by {@link java.text.DecimalFormat}) + * <p> + * Surprisingly perhaps, a string such as "123,99", when parsed ((by {@link java.text.DecimalFormat}) * in an English locale, is not rejected but instead is evaluated as the value 12399L. That's almost * certainly not what the end-user would have expected, and results in a money value 100x too large. + * </p> * - * <p>The purpose of this configuration property is to remove the confusion by simply disallowing the + * <p> + * The purpose of this configuration property is to remove the confusion by simply disallowing the * thousands separator from being part of the input string. + * </p> * - * <p>For maximum safety, allowing the grouping separator is disallowed, but the alternate (original) + * <p> + * For maximum safety, allowing the grouping separator is disallowed, but the alternate (original) * behaviour can be reinstated by setting this config property back to <code>true</code>. + * </p> * - * <p>The same configuration property is also used for rendering the value. + * <p> + * The same configuration property is also used for rendering the value. + * </p> * * @see Display#isUseGroupingSeparator() */ @@ -3394,8 +3407,10 @@ public record Display( /** * The minimum scale to use for all {@link java.math.BigDecimal}s. * - * <p> Is only used if the minimum scale has not been specified explicitly by some other means, typically + * <p> + * Is only used if the minimum scale has not been specified explicitly by some other means, typically * either {@link Digits#fraction()} or an ORM semantic such as the (JPA) {@link Column#scale()}. + * </p> */ Integer minScale, @@ -3415,7 +3430,9 @@ public record Kroki( /** * If set, adds plantuml support to the AsciiDoc value type. * - * <p>Eg. via docker instance like {@literal yuzutech/kroki}. + * <p> + * Eg. via docker instance like {@literal yuzutech/kroki}. + * </p> */ URL backendUrl, diff --git a/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeRegistry.java b/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeRegistry.java index 5374288a57c..3386685b816 100644 --- a/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeRegistry.java +++ b/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeRegistry.java @@ -45,14 +45,14 @@ public class CausewayBeanTypeRegistry { public static CausewayBeanTypeRegistry empty() { return new CausewayBeanTypeRegistry(Can.empty()); } - + /** * (immutable) scan result, as used by the SpecificationLoader for introspection */ private final Can<CausewayBeanMetaData> scannedTypes; private final Can<CausewayBeanMetaData> entities; private final PersistenceStack persistenceStack; - + private final Map<Class<?>, CausewayBeanMetaData> scannedTypesByClass = new HashMap<>(); // -- DISTINCT CATEGORIES OF BEAN SORTS @@ -68,7 +68,7 @@ public static CausewayBeanTypeRegistry empty() { this.scannedTypes = scannedTypes; var entityTypes = new HashMap<Class<?>, CausewayBeanMetaData>(); - + scannedTypes.forEach(typeMeta->{ var cls = typeMeta.getCorrespondingClass(); @@ -103,7 +103,7 @@ public static CausewayBeanTypeRegistry empty() { return; } }); - + this.entities = Can.ofCollection(entityTypes.values()); this.persistenceStack = entities.stream() .map(CausewayBeanMetaData::persistenceStack) @@ -115,14 +115,14 @@ public static CausewayBeanTypeRegistry empty() { // -- FIELDS /** - * Returns 'JDO' or 'JPA' based on metadata found during {@link CausewayBeanTypeClassifier type-classification}. + * Returns the object store in use for this application, based on metadata found during {@link CausewayBeanTypeClassifier type-classification}. * If no (concrete) entity type is found, returns 'UNSPECIFIED'. * @implNote assumes that there can be only one persistence stack */ public PersistenceStack persistenceStack() { - return persistenceStack; + return persistenceStack; } - + // -- STREAMS public Stream<CausewayBeanMetaData> streamScannedTypes() { return scannedTypes.stream(); } @@ -136,7 +136,7 @@ public Stream<Class<?>> streamEntityTypes(final @Nullable PersistenceStack selec .filter(typeMeta->typeMeta.persistenceStack()==selectedStack) .<Class<?>>map(CausewayBeanMetaData::getCorrespondingClass); } - + // -- LOOKUP public Optional<String> lookupDomainServiceNameForType(final Class<?> type) { @@ -147,7 +147,7 @@ public Optional<String> lookupDomainServiceNameForType(final Class<?> type) { public boolean containsManagedBeansContributing(final @NonNull Class<?> type) { return domainServices.containsKey(type); } - + public Optional<CausewayBeanMetaData> lookupScannedType(final Class<?> type) { return Optional.ofNullable(scannedTypesByClass.get(type)); } diff --git a/core/interaction/src/main/adoc/modules/interaction/pages/interactions-commands-and-executions.adoc b/core/interaction/src/main/adoc/modules/interaction/pages/interactions-commands-and-executions.adoc index f4d031247cd..bca198ebb15 100644 --- a/core/interaction/src/main/adoc/modules/interaction/pages/interactions-commands-and-executions.adoc +++ b/core/interaction/src/main/adoc/modules/interaction/pages/interactions-commands-and-executions.adoc @@ -20,7 +20,6 @@ The xref:refguide:testing:index/integtestsupport/applib/CausewayIntegrationTestA Integration tests can also simulate multiple interactions (HTTP requests) within a single test using xref:refguide:applib:index/services/iactnlayer/InteractionService.adoc#nextInteraction_[InteractionService#nextInteraction]. When called, any state changes made in the previous `Interaction` will be committed, and any references to entities should be either discarded or else be re-retrieved in the next `Interaction`. -(In the case of the JDO ORM, any entities from the previous `Interaction` will be reset to null when that `Interaction` completes). [#executions] === Executions diff --git a/core/metamodel/src/main/adoc/modules/metamodel/pages/about.adoc b/core/metamodel/src/main/adoc/modules/metamodel/pages/about.adoc index 1c5d23f6dc6..7beb6fb4bdd 100644 --- a/core/metamodel/src/main/adoc/modules/metamodel/pages/about.adoc +++ b/core/metamodel/src/main/adoc/modules/metamodel/pages/about.adoc @@ -26,7 +26,7 @@ legend top endlegend together { - rectangle "<$database_cube><$at>\n<<Annotation>>\nORM (JPA/JDO)" as PERS + rectangle "<$database_cube><$at>\n<<Annotation>>\nORM (JPA)" as PERS rectangle "<$envira><$at>\n<<Annotation>>\nSpring" as SPRING rectangle "<img:https://causeway.apache.org/_/img/home/causeway-logo-65x48.png><$at>\n<<Annotation>>\nApache Causeway" as FW rectangle "<img:https://causeway.apache.org/_/img/home/causeway-logo-65x48.png><$java>\n<<Supporting Methods>>\nApache Causeway" as SM @@ -174,8 +174,7 @@ Thus: * *_Viewmodels_* and *_Entities_* are specializations of *_Domain Objects_*. ** _View Models_ are (lifecycle-) managed by _Apache Causeway_ -** _Entities_ are managed by the configured persistence layer -(either JDO or JPA). +** _Entities_ are managed by the configured persistence mechanism. * *_Services_* in general are (lifecycle-) managed by _Spring_. + diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java index ca87146bac1..e7e7a16c5c5 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java @@ -566,7 +566,7 @@ private void addValidatorToEnsureUniqueLogicalTypeNames(final ProgrammingModel p public void validateObjectEnter(final ObjectSpecification objSpec) { // @DomainObject(logicalTypeName=...) must be unique among non-abstract types - // Eg. having an ApplicationUser interface and a concrete ApplicationUser (JDO) + // Eg. having an ApplicationUser interface and a concrete ApplicationUser // that have the same @DomainObject(logicalTypeName=...) should be allowed. // A hard constraint that applies, is that there cannot be multiple bookmark-able // types that share the same @DomainObject(logicalTypeName=...). diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/objectvalue/digits/MaxTotalDigitsFacet.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/objectvalue/digits/MaxTotalDigitsFacet.java index ad59ef32c4e..3caf02d15a4 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/objectvalue/digits/MaxTotalDigitsFacet.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/facets/objectvalue/digits/MaxTotalDigitsFacet.java @@ -34,15 +34,15 @@ * <li><tt>12345</tt> has a total of 5 digits</li> * <li><tt>12345.0</tt> has a total of 6 digits</li> * </ul> + * </p> * * <p> - * In JPA's {@link jakarta.persistence.Column}, this corresponds to {@link Column#precision()}. - * - * <p> - * In JDO's <code>@Column</code> annotation, this corresponds to <code>@Column#length</code>. + * In JPA's {@link Column}, this corresponds to {@link Column#precision()}. + * </p> * * <p> * For {@link Digits}, corresponds to sum of {@link Digits#integer()} and {@link Digits#fraction()}. + * </p> */ public interface MaxTotalDigitsFacet extends Facet { diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/objectlifecycle/ObjectLifecyclePublisher.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/objectlifecycle/ObjectLifecyclePublisher.java index 7caac9f2831..7cd52d29f13 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/objectlifecycle/ObjectLifecyclePublisher.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/objectlifecycle/ObjectLifecyclePublisher.java @@ -53,7 +53,7 @@ public interface ObjectLifecyclePublisher { void onPostCreate(ManagedObject domainObject); /** - * Called by both JPA and JDO, just after an object is retrieved from the database. + * Called by the JPA object store, just after an object is retrieved from the database. * * <p> * Default implementation calls <code>EntityChangeTracker#recognizeLoaded(ManagedObject)</code> and @@ -65,7 +65,7 @@ public interface ObjectLifecyclePublisher { void onPostLoad(ManagedObject entity); /** - * Called by both JPA and JDO, just before an entity is inserted into the database. + * Called by the JPA object store, just before an entity is inserted into the database. * * <p> * Default implementation fires callbacks (including emitting the <code>PreStoreEvent</code>, eg as subscribed) @@ -78,7 +78,7 @@ public interface ObjectLifecyclePublisher { void onPrePersist(Either<ManagedObject, ManagedObject> eitherWithOrWithoutOid); /** - * Called by both JPA and JDO, just after an entity has been inserted into the database. + * Called by the JPA object store, just after an entity has been inserted into the database. * * <p> * Default implementation fires callbacks and enlists the entity within <code>EntityChangeTracker</code> @@ -90,7 +90,7 @@ public interface ObjectLifecyclePublisher { void onPostPersist(ManagedObject entity); /** - * Called by both JPA and JDO (though JDO does <i>not</i> provide any changeRecords). + * Called by the JPA object store, just before the object is about to be updated. * * <p> * Default implementation fires callbacks and enlists the entity within <code>EntityChangeTracker</code> @@ -98,13 +98,13 @@ public interface ObjectLifecyclePublisher { * </p> * * @param entity - * @param propertyChangeRecordSupplier - optional parameter to provide the pre-computed - * {@link PropertyChangeRecord}s from the ORM. JPA does this, JDO does not. + * @param propertyChangeRecordSupplier - provides the pre-computed + * {@link PropertyChangeRecord}s from the JPA object store. */ void onPreUpdate(ManagedObject entity, @Nullable Function<ManagedObject, Can<PropertyChangeRecord>> propertyChangeRecordSupplier); /** - * Called by both JPA and JDO, after an existing entity has been updated. + * Called by the JPA object store, after an existing entity has been updated. * * <p> * Default implementation fires callbacks. @@ -115,7 +115,7 @@ public interface ObjectLifecyclePublisher { void onPostUpdate(ManagedObject entity); /** - * Called by both JPA and JDO, just before an entity is deleted from the database. + * Called by the JPA object store, just before an entity is deleted from the database. * * <p> * Default implementation fires callbacks and enlists the entity within <code>EntityChangeTracker</code> diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/session/InteractionServiceDefault.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/session/InteractionServiceDefault.java index 5368b73a0c7..810a262b682 100644 --- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/session/InteractionServiceDefault.java +++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/session/InteractionServiceDefault.java @@ -383,14 +383,14 @@ private void preInteractionClosed(final CausewayInteraction interaction) { // // we check if the transaction is already completed (rolled back/committed). This isn't meant to be the case, // but the suspicion is that if a background command execution encounters a deadlock then (in - // CommandExecutorServiceDefault) then it might be resulting in top-level xactn will end up being rolled back. + // CommandExecutorServiceDefault) then it might be resulting in a top-level xactn that ends up being rolled back. // // The relevant code is in TransactionService#callWithinCurrentTransactionElseCreateNew(...), used by // CommandExecutorServiceDefault but also used quite heavily elsewhere. In normal circumstances I suspect - // everything works out fine, but if there's a deadlock then perhaps we get this different flow + // everything works out fine, but if there's a deadlock then perhaps we get this different flow. // - // the consequences of an incorrect design can be SEVERE. In previous versions of the code base we've seen - // additional changes being made in a new/implicit (?) xactn which furthermore are never committed; we end up + // The consequences of an incorrect design can be SEVERE. In previous versions of the code base we've seen + // additional changes being made in a new/implicit (?) xactn which furthermore is never committed; we end up // with a connection back in Hikari's conn pool with open locks, blocking the entire system as those locks are // on CommandLogEntry. Or, another problem found was seemingly polluting the threadLocals, resulting in an // nio-http-exec thread always failing with an error of: "No JDO PersistenceManager bound to thread, and diff --git a/core/transaction/src/main/java/org/apache/causeway/core/transaction/changetracking/EntityChangeTracker.java b/core/transaction/src/main/java/org/apache/causeway/core/transaction/changetracking/EntityChangeTracker.java index f8b4b89dbf5..cbf02787e05 100644 --- a/core/transaction/src/main/java/org/apache/causeway/core/transaction/changetracking/EntityChangeTracker.java +++ b/core/transaction/src/main/java/org/apache/causeway/core/transaction/changetracking/EntityChangeTracker.java @@ -51,11 +51,11 @@ public interface EntityChangeTracker extends DisposableBean { * * <p> * The post-modification values are captured when the transaction commits. + * </p> * * <p> - * Overload as an optimization for ORMs (specifically, JPA) where already have access to the changed records by - * accessing the ORM-specific data structures (<code>EntityManager</code>'s unit-of-work). - * + * Overload is an optimization for the JPA object store where we already have access to the changed records by + * accessing the ORM-specific data structures ({@link jakarta.persistence.EntityManager}'s "unit-of-work"). * </p> * * @param entity diff --git a/extensions/security/secman/adoc/modules/secman/pages/about.adoc b/extensions/security/secman/adoc/modules/secman/pages/about.adoc index 4c1e176e263..d88a5f50912 100644 --- a/extensions/security/secman/adoc/modules/secman/pages/about.adoc +++ b/extensions/security/secman/adoc/modules/secman/pages/about.adoc @@ -4,7 +4,7 @@ SecMan provides an implementation of both the xref:refguide:core:index/security/authentication/Authenticator.adoc[Authenticator] and xref:refguide:core:index/security/authorization/Authorizor.adoc[Authorizor] SPIs, storing user, roles and permissions information as domain entities (persisted to relational database). -It can be used with both the JDO or JPA persistence mechanisms. +It is supported by the xref:pjpa:ROOT:about.adoc[JPA/Eclipselink] object store. Because these features are implemented using domain entities, it means that this security information can be administered from within your Apache Causeway application. The domain model is explained in more detail <<domain-model,below>>. diff --git a/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc b/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc index 243a0280c70..1874bc949cf 100644 --- a/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc +++ b/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc @@ -224,20 +224,6 @@ Access the configuration properties (from the tertiary menu)) + Browse the application features + permissions (from the "Prototyping" menu). -** `CausewayPersistenceJdoMetaModelRoleAndPermissions.ROLE_NAME` -+ -Download the JDO metamodel (from the "Prototyping" menu). - -// moved to the incubator for the time being -//** `CausewayExtCommandReplayPrimaryRoleAndPermissions.ROLE_NAME` -//+ -//Access to the command replay primary menu -// -//** `CausewayExtCommandReplaySecondaryRoleAndPermissions.ROLE_NAME` -//+ -//Access to the command replay secondary menu -// - ** `CausewayExtH2ConsoleRoleAndPermissions.ROLE_NAME` + Access the h2 console (from the "Prototyping" menu) diff --git a/extensions/security/secman/applib/src/main/java/org/apache/causeway/extensions/secman/applib/role/seed/CausewayPersistenceJpaMetaModelRoleAndPermissions.java b/extensions/security/secman/applib/src/main/java/org/apache/causeway/extensions/secman/applib/role/seed/CausewayPersistenceJpaMetaModelRoleAndPermissions.java new file mode 100644 index 00000000000..93aa743a6e6 --- /dev/null +++ b/extensions/security/secman/applib/src/main/java/org/apache/causeway/extensions/secman/applib/role/seed/CausewayPersistenceJpaMetaModelRoleAndPermissions.java @@ -0,0 +1,53 @@ +/* + * 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 agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.causeway.extensions.secman.applib.role.seed; + +import org.apache.causeway.applib.services.appfeat.ApplicationFeatureId; +import org.apache.causeway.commons.collections.Can; +import org.apache.causeway.extensions.secman.applib.permission.dom.ApplicationPermissionMode; +import org.apache.causeway.extensions.secman.applib.permission.dom.ApplicationPermissionRule; +import org.apache.causeway.extensions.secman.applib.role.fixtures.AbstractRoleAndPermissionsFixtureScript; + +/** + * Sets up a role with access to the menu actions to download the JPA metamodel. + * + * @since 2.0 {@index} + */ +public class CausewayPersistenceJpaMetaModelRoleAndPermissions +extends AbstractRoleAndPermissionsFixtureScript { + + private static final String SERVICE_LOGICAL_TYPE_NAME = "causeway.persistence.jpa.eclipselink.app.JpaMetamodelMenu"; + + public static final String ROLE_NAME = SERVICE_LOGICAL_TYPE_NAME.replace(".","-"); + + public CausewayPersistenceJpaMetaModelRoleAndPermissions() { + super(ROLE_NAME, "Access to download the JPA metamodel"); + } + + @Override + protected void execute(ExecutionContext executionContext) { + newPermissions( + ApplicationPermissionRule.ALLOW, + ApplicationPermissionMode.CHANGING, + Can.of( + ApplicationFeatureId.newType(SERVICE_LOGICAL_TYPE_NAME) + ) + ); + } +} diff --git a/extensions/security/secman/applib/src/main/java/org/apache/causeway/extensions/secman/applib/seed/scripts/SeedUsersAndRolesFixtureScript.java b/extensions/security/secman/applib/src/main/java/org/apache/causeway/extensions/secman/applib/seed/scripts/SeedUsersAndRolesFixtureScript.java index b1c4804c509..b62fb6d4a15 100644 --- a/extensions/security/secman/applib/src/main/java/org/apache/causeway/extensions/secman/applib/seed/scripts/SeedUsersAndRolesFixtureScript.java +++ b/extensions/security/secman/applib/src/main/java/org/apache/causeway/extensions/secman/applib/seed/scripts/SeedUsersAndRolesFixtureScript.java @@ -23,6 +23,8 @@ import jakarta.inject.Inject; +import org.apache.causeway.extensions.secman.applib.role.seed.CausewayPersistenceJpaMetaModelRoleAndPermissions; + import org.jspecify.annotations.Nullable; import org.apache.causeway.applib.services.appfeat.ApplicationFeatureId; @@ -115,9 +117,9 @@ protected void execute(final ExecutionContext executionContext) { // modules executionContext.executeChildren(this, new CausewayAppFeatureRoleAndPermissions(), - persistenceStack == PersistenceStack.JDO - ? new CausewayPersistenceJdoMetaModelRoleAndPermissions() - : null, // skip if non-JDO deployment + persistenceStack == PersistenceStack.JPA + ? new CausewayPersistenceJpaMetaModelRoleAndPermissions() + : null, // skip if non-JPA deployment new CausewayExtAuditTrailRoleAndPermissions(), new CausewayExtCommandLogRoleAndPermissions(), new CausewayExtDocgenRoleAndPermissions(), @@ -137,9 +139,9 @@ protected void execute(final ExecutionContext executionContext) { new CausewayExtSecmanRegularUserRoleAndPermissions(secmanConfig), new CausewayExtSecmanAdminUser(secmanConfig, CausewayAppFeatureRoleAndPermissions.ROLE_NAME, - persistenceStack == PersistenceStack.JDO - ? CausewayPersistenceJdoMetaModelRoleAndPermissions.ROLE_NAME - : null, // skip if non-JDO deployment + persistenceStack == PersistenceStack.JPA + ? CausewayPersistenceJpaMetaModelRoleAndPermissions.ROLE_NAME + : null, // skip if non-JPA deployment CausewayExtAuditTrailRoleAndPermissions.ROLE_NAME, CausewayExtCommandLogRoleAndPermissions.ROLE_NAME, CausewayExtDocgenRoleAndPermissions.ROLE_NAME, diff --git a/mavendeps/adoc/modules/mavendeps/pages/about.adoc b/mavendeps/adoc/modules/mavendeps/pages/about.adoc index 0327b0489f3..963ecd6b8f1 100644 --- a/mavendeps/adoc/modules/mavendeps/pages/about.adoc +++ b/mavendeps/adoc/modules/mavendeps/pages/about.adoc @@ -3,7 +3,6 @@ :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 [...] The `causeway-mavendeps-webapp` aggregates the main runtime dependencies of a production webapp. -Note that it does _not_ include the runtime dependencies for either JDO or JPA; these must be included separately. To use, add the following : @@ -31,7 +30,7 @@ However, it does _not_ include a security implementation, a viewer implementatio * for persistence, add xref:pjpa:ROOT:about.adoc[JPA/Eclipselink]. -* viewer, you will almost certainly want to add xref:vw:ROOT:about.adoc[Wicket] and you might also add xref:vro:ROOT:about.adoc[Restful Objects]. +* viewer, you will almost certainly want to add xref:vw:ROOT:about.adoc[Wicket] and you might also add xref:vro:ROOT:about.adoc[Restful Objects] and/or the xref:gqlv:ROOT:about.adoc[]. Also, remember that adding the class onto the classpath does _not_ make that functionality available (Apache Causeway does not currently leverage Spring Boot's link:https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-auto-configuration[auto configuration] capabilities). You must therefore also add in the appropriate `CausewayModuleXxx` to your application's top-level link:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Configuration.html[@Configuration] (aka "app manifest"). diff --git a/persistence/jpa/eclipselink/src/main/java/module-info.java b/persistence/jpa/eclipselink/src/main/java/module-info.java index 5b75aa7d259..15abad4a39c 100644 --- a/persistence/jpa/eclipselink/src/main/java/module-info.java +++ b/persistence/jpa/eclipselink/src/main/java/module-info.java @@ -20,6 +20,8 @@ exports org.apache.causeway.persistence.jpa.eclipselink.inject; exports org.apache.causeway.persistence.jpa.eclipselink; exports org.apache.causeway.persistence.jpa.eclipselink.config; + exports org.apache.causeway.persistence.jpa.eclipselink.services; + exports org.apache.causeway.persistence.jpa.eclipselink.app; requires static lombok; diff --git a/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java b/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java index 54baf7dfd28..add1333d4e0 100644 --- a/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java +++ b/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java @@ -220,7 +220,7 @@ && getJdbcExceptionTranslator() != null) { * Template method for extracting a SQL String from the given exception. * <p>Default implementation always returns {@code null}. Can be overridden in * subclasses to extract SQL Strings for vendor-specific exception classes. - * @param ex the JDOException, containing a SQLException + * @param ex the throwable to be processed, typically containing some sort of SQL Exception * @return the SQL String, or {@code null} if none found */ private String extractSqlStringFromException(final Throwable ex) { diff --git a/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/app/JpaMetamodelMenu.java b/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/app/JpaMetamodelMenu.java new file mode 100644 index 00000000000..c6c35ad4c3e --- /dev/null +++ b/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/app/JpaMetamodelMenu.java @@ -0,0 +1,10 @@ +package org.apache.causeway.persistence.jpa.eclipselink.app; + +import org.apache.causeway.applib.annotation.DomainService; + +@DomainService() +public class JpaMetamodelMenu { + + // Placeholder + +} diff --git a/persistence/jpa/metamodel/src/main/java/org/apache/causeway/persistence/jpa/metamodel/facets/prop/column/MaxLengthFromJpaColumnAnnotationFacetFactory.java b/persistence/jpa/metamodel/src/main/java/org/apache/causeway/persistence/jpa/metamodel/facets/prop/column/MaxLengthFromJpaColumnAnnotationFacetFactory.java index f06874df332..3e5bfac1c96 100644 --- a/persistence/jpa/metamodel/src/main/java/org/apache/causeway/persistence/jpa/metamodel/facets/prop/column/MaxLengthFromJpaColumnAnnotationFacetFactory.java +++ b/persistence/jpa/metamodel/src/main/java/org/apache/causeway/persistence/jpa/metamodel/facets/prop/column/MaxLengthFromJpaColumnAnnotationFacetFactory.java @@ -40,9 +40,6 @@ public MaxLengthFromJpaColumnAnnotationFacetFactory(final MetaModelContext mmc) @Override public void process(final ProcessMethodContext processMethodContext) { - // only applies to JDO entities; ignore any view models - final Class<?> cls = processMethodContext.getCls(); - if(String.class != processMethodContext.getMethod().getReturnType()) { return; } diff --git a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/conf/Configuration_usingWicket.java b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/conf/Configuration_usingWicket.java index d833ce9d51e..d4847d312c0 100644 --- a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/conf/Configuration_usingWicket.java +++ b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/conf/Configuration_usingWicket.java @@ -111,17 +111,6 @@ public static class DomainObjectPageTester // -- BOOK PAGE - /** strange asymmetry with JPA, to investigate another day */ - public static final String BOOK_DELETE_ACTION_JDO = "theme:domainObjectContainer:domainObject:rows:2" - + ":rowContents:1" - + ":col:rows:1:rowContents:1:col:tabGroups:1" - + ":panel:tabPanel" - + ":rows:1:rowContents:1" - + ":col:fieldSets:1:memberGroup" - + ":panelHeading:associatedActionLinksPanel" - + ":additionalLinkList:additionalLinkItem:0:actionLink"; - - /** strange asymmetry with JDO, to investigate another day */ public static final String BOOK_DELETE_ACTION_JPA = "theme:domainObjectContainer:domainObject:rows:2" + ":rowContents:1" + ":col:rows:1:rowContents:1:col:tabGroups:1" @@ -161,12 +150,6 @@ public static enum SimulatedProperties implements SimulatedProperty { + ":col:fieldSets:1" + ":memberGroup:properties:1" + ":property"), - JDO_BOOK_ISBN("theme:domainObjectContainer:domainObject:rows:2" - + ":rowContents:1:col:rows:1:rowContents:1" - + ":col:tabGroups:1:panel:tabPanel:rows:1:rowContents:1:col" - + ":fieldSets:1" - + ":memberGroup:properties:3" - + ":property"), JPA_BOOK_ISBN("theme:domainObjectContainer:domainObject:rows:2" + ":rowContents:1:col:rows:1:rowContents:1" + ":col:tabGroups:1:1" diff --git a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/fixtures/EntityTestFixtures.java b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/fixtures/EntityTestFixtures.java index 3161c7fd380..a0e3c68070a 100644 --- a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/fixtures/EntityTestFixtures.java +++ b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/fixtures/EntityTestFixtures.java @@ -213,14 +213,7 @@ public final synchronized Lock aquireLock() { return lock; } - /** XXX sporadically seeing errors like - * ---- - * Error: (bad sql grammar exception): Column "INVENTORY_ID_EID" not found; SQL statement: - * INSERT INTO "testdomain"."JdoProduct" - * ("id","description","name","price","author","isbn","publisher","DISCRIMINATOR","INVENTORY_ID_EID") - * VALUES (?,?,?,?,?,?,?,?,?) [42122-214] - * ---- - * This is an attempt to force the JDO schema to properly initialize. */ + /** To force the schema to properly initialize. */ protected void initSchema() {} @SneakyThrows diff --git a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/publishing/stubs/ExecutionPublishingTestAbstract.java b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/publishing/stubs/ExecutionPublishingTestAbstract.java index 9a9fd791f08..bf9576e12ab 100644 --- a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/publishing/stubs/ExecutionPublishingTestAbstract.java +++ b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/publishing/stubs/ExecutionPublishingTestAbstract.java @@ -113,8 +113,6 @@ protected void verify( @SneakyThrows private Class<?> bookClass() { switch(getPersistenceStandard()) { - case JDO: - return _Context.loadClass("org.apache.causeway.testdomain.jdo.entities.JdoBook"); case JPA: return _Context.loadClass("org.apache.causeway.testdomain.jpa.entities.JpaBook"); default: diff --git a/regressiontests/incubating/log4j2-test.xml b/regressiontests/incubating/log4j2-test.xml index 0ed7986e245..2876a7ed092 100644 --- a/regressiontests/incubating/log4j2-test.xml +++ b/regressiontests/incubating/log4j2-test.xml @@ -40,39 +40,17 @@ under the License. <Logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="error" /> <Logger name="org.hibernate.validator.internal.util.Version" level="warn" /> <logger name="org.springframework.boot.actuate.endpoint.jmx" level="warn"/> - + <logger name="org.apache.directory" level="warn"/> <logger name="org.apache.directory.api.ldap.model.entry.Value" level="off"/> - + <logger name="DataNucleus.Persistence" level="info"/> <logger name="DataNucleus.Transaction" level="info"/> <logger name="DataNucleus.Datastore.Schema" level="info"/> <logger name="DataNucleus.Datastore.Native" level="info"/> - + <Root level="info"> <AppenderRef ref="Console" /> </Root> </Loggers> </Configuration> - -<!-- # DataNucleus Logging Categories --> -<!-- DataNucleus.Persistence - All messages relating to the persistence process --> -<!-- DataNucleus.Transaction - All messages relating to transactions --> -<!-- DataNucleus.Connection - All messages relating to Connections. --> -<!-- DataNucleus.Query - All messages relating to queries --> -<!-- DataNucleus.Cache - All messages relating to the DataNucleus Cache --> -<!-- DataNucleus.MetaData - All messages relating to MetaData --> -<!-- DataNucleus.Datastore - All general datastore messages --> -<!-- DataNucleus.Datastore.Schema - All schema related datastore log messages --> -<!-- DataNucleus.Datastore.Persist - All datastore persistence messages --> -<!-- DataNucleus.Datastore.Retrieve - All datastore retrieval messages --> -<!-- DataNucleus.Datastore.Native - Log of all 'native' statements sent to the datastore --> -<!-- DataNucleus.General - All general operational messages --> -<!-- DataNucleus.Lifecycle - All messages relating to object lifecycle changes --> -<!-- DataNucleus.ValueGeneration - All messages relating to value generation --> -<!-- DataNucleus.Enhancer - All messages from the DataNucleus Enhancer. --> -<!-- DataNucleus.SchemaTool - All messages from DataNucleus SchemaTool --> -<!-- DataNucleus.JDO - All messages general to JDO --> -<!-- DataNucleus.JPA - All messages general to JPA --> -<!-- DataNucleus.JCA - All messages relating to Connector JCA. --> -<!-- DataNucleus.IDE - Messages from the DataNucleus IDE. --> \ No newline at end of file diff --git a/retired/scripts/enhance.sh b/retired/scripts/enhance.sh deleted file mode 100755 index 91e9d854fc8..00000000000 --- a/retired/scripts/enhance.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env bash -# -# 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 agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# - -usage() { - echo "$(basename $0): [-a] [-c] [-e] [-o] [-m] [-s] [-d] [-t] [-u] [-w]" >&2 - echo " -a : audit trail (extensions/security)" >&2 - echo " -c : command log (extensions/core)" >&2 - echo " -e : execution log (extensions/core)" >&2 - echo " -o : execution outbox (extensions/core)" >&2 - echo " -m : secman (extensions/security)" >&2 - echo " -s : session log (extensions/security)" >&2 - echo " -d : demo (examples/demo/domain)" >&2 - echo " -t : JDO regression tests (regressiontests/stable)" >&2 - echo " -u : JDO regression tests (regressiontests/stable-cmdexecauditsess)" >&2 - echo " -A : add -am (also make)" >&2 -} - - - -AUDITTRAIL="" -COMMANDLOG="" -DEMO="" -EXECUTIONLOG="" -EXECUTIONOUTBOX="" -REGRESSIONTESTS_STABLE="" -REGRESSIONTESTS_CMDEXECAUDITSESS="" -SECMAN="" -SESSIONLOG="" -ALSO_MAKE="" - -PATHS=() -ALL_IF_REQUIRED="" - -while getopts ":acdeomshtuwA" arg; do - case $arg in - h) - usage - exit 0 - ;; - a) - AUDITTRAIL="enhance" - PATHS+=( "extensions/security/audittrail/persistence-jdo" ) - ;; - c) - COMMANDLOG="enhance" - PATHS+=( "extensions/core/commandlog/persistence-jdo" ) - ;; - e) - EXECUTIONLOG="enhance" - PATHS+=( "extensions/core/executionlog/persistence-jdo" ) - ;; - m) - SECMAN="enhance" - PATHS+=( "extensions/security/secman/persistence-jdo" ) - ;; - o) - EXECUTIONOUTBOX="enhance" - PATHS+=( "extensions/core/executionoutbox/persistence-jdo" ) - ;; - s) - SESSIONLOG="enhance" - PATHS+=( "extensions/security/sessionlog/persistence-jdo" ) - ;; - d) - DEMO="enhance" - PATHS+=( "examples/demo/domain" ) - ;; - t) - REGRESSIONTESTS_STABLE="enhance" - PATHS+=( "regressiontests/stable" ) - ALL_IF_REQUIRED="-Dmodule-all" - ;; - u) - REGRESSIONTESTS_CMDEXECAUDITSESS="enhance" - PATHS+=( "regressiontests/stable-cmdexecauditsess/persistence-jdo" ) - ALL_IF_REQUIRED="-Dmodule-all" - ;; - A) - ALSO_MAKE="-am" - ;; - *) - usage - exit 1 - esac -done - -shift $((OPTIND-1)) - -echo "AUDITTRAIL : $AUDITTRAIL" -echo "COMMANDLOG : $COMMANDLOG" -echo "EXECUTIONLOG : $EXECUTIONLOG" -echo "EXECUTIONOUTBOX : $EXECUTIONOUTBOX" -echo "SECMAN : $SECMAN" -echo "SESSIONLOG : $SESSIONLOG" -echo "DEMO : $DEMO" -echo "REGRESSIONTESTS_STABLE : $REGRESSIONTESTS_STABLE" -echo "REGRESSIONTESTS_CMDEXECAUDITSESS : $REGRESSIONTESTS_CMDEXECAUDITSESS" -echo "" -echo "ALSO_MAKE : $ALSO_MAKE" - - -printf -v PATHS_SPLATTED '%s,' "${PATHS[@]}" -PL_ARG=$(echo "${PATHS_SPLATTED%,}") - -PL_ARG="$PL_ARG $ALL_IF_REQUIRED" - -if [ "$PL_ARG" = " " ]; then - usage - exit 1 -fi - -echo mvn install -DskipTests -o -T1C $ALSO_MAKE -pl $PL_ARG -mvn install -DskipTests -o -T1C $ALSO_MAKE -pl $PL_ARG
