You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/03/16 16:05:46 UTC

[causeway] 03/03: CAUSEWAY-3381 : updates javadoc, is all

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit bc586311cbe7f31d81774e3bf96cbf3962ed243b
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Mar 16 16:05:27 2023 +0000

    CAUSEWAY-3381 : updates javadoc, is all
---
 .../org/apache/causeway/applib/annotation/DomainObject.java   |  3 ++-
 .../fixtures/applib/fixturescripts/FixtureScripts.java        | 11 ++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

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 03372d3d31..6cfcd9847e 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
@@ -51,7 +51,8 @@ import org.apache.causeway.applib.services.bookmark.Bookmark;
  * </p>
  *
  * @apiNote Meta annotation {@link Component} allows for the Spring framework to pick up (discover) the
- * annotated type.
+ * annotated type.  However, the custom {@link Scope} of &quot;causeway-domain-object&quot; is a clue that these
+ * objects (either entities or view models) <i>cannot</i> be obtained from the Spring application context.
  * For more details see <code>org.apache.causeway.core.config.beans.CausewayBeanFactoryPostProcessorForSpring</code>
  *
  * @see Action
diff --git a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java
index 8e1ad0763f..716602e686 100644
--- a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java
+++ b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java
@@ -296,7 +296,16 @@ public class FixtureScripts {
      *     Also allows arbitrary parameters to be specified for said fixture script.
      * </p>
      *
-     * @param fixtureScriptName
+     * <p>
+     *     <b>NOTE</b>: this method can only be used for {@link FixtureScript} implementations that are discoverable
+     *     by Spring (eg annotated with {@link org.springframework.stereotype.Service} or
+     *     {@link org.springframework.stereotype.Component}.  <i>Moreover</i>, the {@link FixtureScript} must <i>not</i>
+     *     be a view model, ie must not be annotated with {@link org.apache.causeway.applib.annotation.DomainObject}.
+     *     (This is because the lifecycle of view models is unknown to by Spring).
+     *     Instead, use {@link #runFixtureScript(FixtureScript, String)}, passing in the {@link FixtureScript} instance.
+     * </p>
+     *
+     * @param fixtureScriptName - the {@link FixtureScript#getFriendlyName() (friendly) name} of the {@link FixtureScript}.
      * @param parameters
      */
     @Action(