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 b72cc67e9f9f2cb54e636a5f8712364ab8784be7 Author: Dan Haywood <[email protected]> AuthorDate: Fri Oct 17 13:53:17 2025 +0100 CAUSEWAY-3866: removes references to javax.jdo.annotation --- .../applib/pages/index/annotation/Optionality.adoc | 2 +- .../applib/pages/index/annotation/Property.adoc | 2 +- .../hooks/PropertyLayout_31_typicalLength.adoc | 3 +- .../annotation/hooks/Property_021-optionality.adoc | 7 +- .../annotation/hooks/Property_023-maxLength.adoc | 5 +- .../RepositoryService_020-examples-and-usage.adoc | 62 +- .../refguide/modules/applib-ant/pages/Column.adoc | 13 +- .../refguide/modules/applib-ant/pages/Digits.adoc | 16 +- .../ROOT/partials/2024/2.0.0/_relnotes.adoc | 1 + .../further-business-logic-worked-examples.txt | 708 --------------------- .../modules/ROOT/partials/domain-entities/jpa.adoc | 24 +- .../properties-collections-actions/actions.adoc | 12 +- .../causeway/applib/annotation/Property.java | 4 +- .../commons/internal/reflection/_ClassCache.java | 7 - .../internal/reflection/_ClassCacheUtil.java | 27 +- .../config/beans/CausewayBeanTypeClassifier.java | 3 - .../demoapp/todomodule/dom/ExcelDemoToDoItem.java | 47 -- extensions/vw/pdfjs/fixtures/.gitignore | 1 - extensions/vw/pdfjs/fixtures/pom.xml | 70 -- .../src/main/java/META-INF/persistence.xml | 26 - .../wicket/pdfjs/fixture/PdfjsFixturesModule.java | 35 - .../demomodule/dom/PdfJsDemoObjectWithBlob.java | 123 ---- .../dom/PdfJsDemoObjectWithBlobMenu.java | 68 -- ...fJsDemoObjectWithBlob_createUpTo5_fakeData.java | 133 ---- .../PdfJsDemoObjectWithBlob_tearDown.java | 32 - .../adoc/modules/starters/pages/helloworld.adoc | 3 +- .../adoc/modules/starters/pages/simpleapp.adoc | 3 +- .../demomodule/dom/FakeDataDemoObjectWithAll.java | 29 - .../adoc/modules/ROOT/pages/hints-and-tips.adoc | 1 - .../ROOT/pages/hints-and-tips/troubleshooting.adoc | 88 --- 30 files changed, 76 insertions(+), 1479 deletions(-) diff --git a/antora/components/refguide-index/modules/applib/pages/index/annotation/Optionality.adoc b/antora/components/refguide-index/modules/applib/pages/index/annotation/Optionality.adoc index 7986afc8f93..29d75476652 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/annotation/Optionality.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/annotation/Optionality.adoc @@ -30,7 +30,7 @@ Indicates that the property or parameter is not required. <.> xref:#MANDATORY[MANDATORY] + -- -Indicates that the property is required (even if the JDO `javax.jdo.annotations.Column` annotation says otherwise). +Indicates that the property is required (even if the JPA `jakarta.persistence.Column` annotation says otherwise). -- <.> xref:#NOT_SPECIFIED[NOT_SPECIFIED] + diff --git a/antora/components/refguide-index/modules/applib/pages/index/annotation/Property.adoc b/antora/components/refguide-index/modules/applib/pages/index/annotation/Property.adoc index 19974e6d642..d4cc4b5d78c 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/annotation/Property.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/annotation/Property.adoc @@ -199,7 +199,7 @@ NOTE: this will usually be supplemented by a JDO or JPA-specific annotation to i Indicates whether the property should be included or excluded from mementos. -To ensure that the property is actually not persisted in the objectstore, also annotate with the JDO annotation `javax.jdo.annotations.NotPersistent` +To ensure that the property is actually not persisted in the objectstore, also annotate with the JPA annotation `jakarta.persistence.Transient` [#mustSatisfy] === mustSatisfy diff --git a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/PropertyLayout_31_typicalLength.adoc b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/PropertyLayout_31_typicalLength.adoc index fc935505179..2d9313b8fa1 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/PropertyLayout_31_typicalLength.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/PropertyLayout_31_typicalLength.adoc @@ -15,12 +15,13 @@ For example: [source,java] ---- +import jakarta.persistence.Column; import lombok.Getter; import lombok.Setter; public class Customer { - @javax.jdo.annotations.Column(length=30) + @Column(length=30) @ParameterLayout(typicalLength=20) @Getter @Setter private String firstName; diff --git a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_021-optionality.adoc b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_021-optionality.adoc index baff5b7898c..624b90201f2 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_021-optionality.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_021-optionality.adoc @@ -84,17 +84,16 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; +import lombok.*; @Entity @Inheritance(type = InheritanceType.SINGLE_TABLE) public class CreditCardPaymentMethod extends PaymentMethod { - @javax.jdo.annotations.Column(allowsNull="true") + @Column(nullable=true) + @Getter @Setter private String cardNumber; - public String getCardNumber() { return this.cardNumber; } - public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; } - // ... } ---- diff --git a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_023-maxLength.adoc b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_023-maxLength.adoc index ae559970b0b..35285cec8c6 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_023-maxLength.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/Property_023-maxLength.adoc @@ -15,12 +15,13 @@ For example: [source,java] ---- -import lombok.Getter; +import jakarta.persistence.Column; +import lombok.*; import lombok.Setter; public class Customer { - @javax.jdo.annotations.Column(length=30) + @Column(length=30) @Getter @Setter private String firstName; diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/repository/hooks/RepositoryService_020-examples-and-usage.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/repository/hooks/RepositoryService_020-examples-and-usage.adoc index 936b3b54449..895ed1efb9e 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/services/repository/hooks/RepositoryService_020-examples-and-usage.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/services/repository/hooks/RepositoryService_020-examples-and-usage.adoc @@ -114,60 +114,52 @@ public void addExcludedProduct() { There are two subtypes of the `Query` API, namely `NamedQuery` and `AllInstancesQuery`. The former is the more important, as it identifies a named query and a set of parameter/argument tuples, and is executed server-side. -For example, using JDO a `ToDoItem` could be annotated: +For example, using JPA an entity could be annotated: [source,java] ---- [email protected]( { - @javax.jdo.annotations.Query( - name = "findByAtPathAndComplete", language = "JDOQL", // <.> - value = "SELECT " - + "FROM todoapp.dom.module.todoitem.ToDoItem " - + "WHERE atPath.indexOf(:atPath) == 0 " // <.> - + " && complete == :complete"), // <.> - // ... +@NamedQueries({ + @NamedQuery( + name = "SimpleObject.findByNameLike", // <.> + query = "SELECT so " + + "FROM SimpleObject so " + + "WHERE so.name LIKE :name" // <.> + ) +}) }) -public class ToDoItem ... { +public class SimpleObject ... { // ... } ---- -<1> name of the query -<2> defines the `atPath` parameter -<3> defines the `complete` parameter +<.> name of the query +<.> defines the `name` parameter -This JDO query definitions are used in the `ToDoItemRepositoryImplUsingJdoql` service: +This query definition is then typically used in a corresponding repository service: [source,java] ---- -import org.springframework.stereotype.Service; - -@Service -public class ToDoItemRepositoryImplUsingJdoql implements ToDoItemRepositoryImpl { - @Programmatic - public List<ToDoItem> findByAtPathAndCategory(final String atPath, final Category category) { - return repositoryService.allMatches( - Query.named(ToDoItem.class, "findByAtPathAndCategory") // <.> - .withParameter("atPath", atPath) // <.> - .withParameter("category", category)); // <.> - } - ... - @javax.inject.Inject - RepositoryService repositoryService; +import org.apache.causeway.applib.services.repository.RepositoryService; + +public List<SimpleObject> findByNameLike( + @Name final String name) { + return repositoryService.allMatches( + Query.named(SimpleObject.class, "SimpleObject.findByNameLike") // <.> + .withParameter("name", "%" + name + "%")); // <.> } + +@Inject RepositoryService repositoryService; // <.> ---- -<1> corresponds to the "findByAtPathAndCategory" JDO named query -<2> provide argument for the `atPath` parameter. -<3> provide argument for the `category` parameter. +<1> name of the query +<2> argument for the `name` parameter. +<3> generic repository service, provided by Causeway [TIP] ==== -It is also possible to use the Spring Data repositories, using xref:refguide:persistence:index/jpa/applib/services/JpaSupportService.adoc[JpaSupportService]. +It is also possible to use the Spring Data repositories, which automatically generate an implementation based on the method signature. +Or, you could use the xref:querydsl:ROOT:about.adoc[QueryDSL] integration. ==== - - - == See also Supporting classes used by the API: diff --git a/antora/components/refguide/modules/applib-ant/pages/Column.adoc b/antora/components/refguide/modules/applib-ant/pages/Column.adoc index 40103bb7000..01380b0cc7c 100644 --- a/antora/components/refguide/modules/applib-ant/pages/Column.adoc +++ b/antora/components/refguide/modules/applib-ant/pages/Column.adoc @@ -91,10 +91,17 @@ For example: [source,java] ---- +import jakarta.persistence.Column; +import lombok.*; + public class Customer { - @javax.jdo.annotations.Column(length=10, scale=2) - public BigDecimal getTotalOrdersToDate() { /* ... */ } - public void setTotalOrdersToDate(BigDecimal totalOrdersToDate) { /* ... */ } + + @Column(length=10, scale=2) + @Getter @Setter + private BigDecimal totalOrdersToDate; + + //... +} ---- For ``BigDecimal``s it is also possible to specify the xref:refguide:applib-ant:Digits.adoc[@Digits] annotation, whose form is `@Digits(integer, fraction)`. diff --git a/antora/components/refguide/modules/applib-ant/pages/Digits.adoc b/antora/components/refguide/modules/applib-ant/pages/Digits.adoc index cfa01d53e1e..5f405655164 100644 --- a/antora/components/refguide/modules/applib-ant/pages/Digits.adoc +++ b/antora/components/refguide/modules/applib-ant/pages/Digits.adoc @@ -1,5 +1,5 @@ -[#javax-validation-constraints-Digits] -= @Digits (javax.validation) +[#jakarta-validation-constraints-Digits] += @Digits (jakarta.validation.constraints) :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 [...] @@ -12,16 +12,18 @@ For example: [source,java] ---- [email protected]( +import jakarta.persistence.Column; +import jakarta.validation.constraints.Digits; +import lombok.Getter; + +@Column( scale=2 // <.> ) [email protected]( +@Digits( integer=10, fraction=2 // <.> ) -public BigDecimal getCost() { - return cost; -} +@Getter public void setCost(final BigDecimal cost) { this.cost = cost!=null ? cost.setScale(2, BigDecimal.ROUND_HALF_EVEN) // <.> diff --git a/antora/components/relnotes/modules/ROOT/partials/2024/2.0.0/_relnotes.adoc b/antora/components/relnotes/modules/ROOT/partials/2024/2.0.0/_relnotes.adoc index 5f195b5a5ea..7718e747a7c 100644 --- a/antora/components/relnotes/modules/ROOT/partials/2024/2.0.0/_relnotes.adoc +++ b/antora/components/relnotes/modules/ROOT/partials/2024/2.0.0/_relnotes.adoc @@ -64,6 +64,7 @@ Persistence using JDO continues to be supported through the integration with Dat [NOTE] ==== We use EclipseLink rather than Hibernate because historically the latter was licensed using LGPL, which is incompatible with ASF licensing. +(Hibernate v7 is licensed under Apache License, however, so this opens up the possibility of providing a JPA/Hibernate object store in the future). ==== + diff --git a/antora/components/tutorials/modules/petclinic/pages/further-business-logic-worked-examples.txt b/antora/components/tutorials/modules/petclinic/pages/further-business-logic-worked-examples.txt deleted file mode 100644 index 016e26d378a..00000000000 --- a/antora/components/tutorials/modules/petclinic/pages/further-business-logic-worked-examples.txt +++ /dev/null @@ -1,708 +0,0 @@ -= Adding further business logic - Worked Examples - -: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 [...] - -// LATER - -//Let's remind ourselves of the original use cases we identified; some of these have been implemented already (admittedly, not all with tests around them): -// -//* create an `PetOwner` : yes, implemented -// -//* add and remove ``Pet``s for said `PetOwner` : yes, implemented. -// -//* book a `Pet` in for a `Visit`: yes, implemented. -// -//* enter an `outcome` and `cost` of a `Visit`: not yet -// -//* allow an `PetOwner` to pay for a `Visit`: not yet -// -//* find ``Visit``s not yet paid and overdue (more than 28 days old): not yet -// -//* delete an `PetOwner` and its ``Pet``s and ``Visit``s, so long as there are no unpaid ``Visit``s: partly. -//We currently just delete everything. -// -//In this section we'll implement the missing functionality, along with unit or integration tests as necessary. -// -// -//== Enter an outcome -// -//An outcome for a `Visit` consists of a diagnosis, and also the cost to be paid by the ``Pet``'s `PetOwner`. -// -//image::Visit-enterOutcome.png[width="800px",link="_images/Visit-enterOutcome.png"] -// -//=== Solution -// -//[source,bash,subs="attributes+"] -//---- -//git checkout tags/{tag-version}/330-enter-an-outcome -//mvn clean package jetty:run -//---- -// -// -//=== Exercise -// -//* add a new integration test, `Visit_enterOutcome_IntegTest`, -//+ -//[source,java] -//---- -//public class Visit_enterOutcome_IntegTest extends PetClinicModuleIntegTestAbstract { -// -// Visit visit; -// -// @Before -// public void setup() { -// // given -// Owner owner = runBuilderScript(Owner_enum.JOHN_SMITH); -// Pet pet = owner.getPets().first(); -// visit = wrap(mixin(Pet_visits.class, pet)).coll().iterator().next(); -// } -// -// @Test -// public void happy_case() { -// -// // when -// String diagnosis = someRandomDiagnosis(); -// BigDecimal cost = someRandomCost(); -// -// wrap(visit).enterOutcome(diagnosis, cost); -// -// // then -// assertThat(visit.getDiagnosis()).isEqualTo(diagnosis); -// assertThat(visit.getCost()).isEqualTo(cost); -// } -// -// private BigDecimal someRandomCost() { -// return new BigDecimal(20.00 + fakeDataService.doubles().upTo(30.00d)); -// } -// -// private String someRandomDiagnosis() { -// return fakeDataService.lorem().paragraph(3); -// } -// -// @Inject -// FakeDataService fakeDataService; -//} -//---- -// -//* in `Visit`, add in the two new properties and action. -//+ -//[source,java] -//---- -//@Action(semantics = SemanticsOf.IDEMPOTENT) -//public Visit enterOutcome( -// @Parameter(maxLength = 4000) -// @ParameterLayout(multiLine = 5) -// final String diagnosis, -// final BigDecimal cost) { -// this.diagnosis = diagnosis; -// this.cost = cost; -// return this; -//} -// -//@javax.jdo.annotations.Column(allowsNull = "true", length = 4000) -//@Property(editing = Editing.DISABLED, editingDisabledReason = "Use 'enter outcome' action") -//@PropertyLayout(multiLine = 5) -//@Getter @Setter -//private String diagnosis; -// -//@javax.jdo.annotations.Column(allowsNull = "true", length = 6, scale = 2) -//@Property(editing = Editing.DISABLED, editingDisabledReason = "Use 'enter outcome' action") -//@Getter @Setter -//private BigDecimal cost; -// -//---- -// -//* update `Visit.layout.xml` for the two new properties and action. -// -//* add in some further integration tests to ensure that the properties cannot be edited directly: -//+ -//[source,java] -//---- -//@Test -//public void cannot_edit_outcome_directly() { -// -// // expecting -// expectedExceptions.expect(DisabledException.class); -// expectedExceptions.expectMessage("Use 'enter outcome' action"); -// -// // when -// String diagnosis = someRandomDiagnosis(); -// wrap(visit).setDiagnosis(diagnosis); -//} -// -//@Test -//public void cannot_edit_cost_directly() { -// -// // expecting -// expectedExceptions.expect(DisabledException.class); -// expectedExceptions.expectMessage("Use 'enter outcome' action"); -// -// // when -// BigDecimal cost = someRandomCost(); -// -// wrap(visit).setCost(cost); -//} -//---- -// -// -//== Pay for a visit -// -//We'll support this use case through a new action "paid", on the `Visit` domain entity. -// -//To support the testing (and with half an eye to a future use case) we'll also implement a "findNotPaid" query on the `Visits` repository domain service. -// -//=== Solution -// -//[source,bash,subs="attributes+"] -//---- -//git checkout tags/{tag-version}/340-pay-for-a-visit -//mvn clean package jetty:run -//---- -// -// -//=== Exercise -// -//Let's first work on the happy case: -// -//* Update `Visit` with a new `paid()` action and `paidOn` property. -//Also inject `ClockService`: -//+ -//[source,java] -//---- -//@Action(semantics = SemanticsOf.IDEMPOTENT) -//public Visit paid() { -// paidOn = clockService.now(); -// return this; -//} -// -//@javax.jdo.annotations.Column(allowsNull = "true") -//@Property(editing = Editing.DISABLED, editingDisabledReason = "Use 'paid' action") -//@Getter @Setter -//private LocalDate paidOn; -// -//... -// -//@Inject -//ClockService clockService; -//---- -// -//* Update the `Visits` domain service repository to find ``Visit``s that haven't been paid: -//+ -//[source,java] -//---- -//@Programmatic -//public java.util.List<Visit> findNotPaid() { -// TypesafeQuery<Visit> q = causewayJdoSupport.newTypesafeQuery(Visit.class); -// final QVisit cand = QVisit.candidate(); -// q = q.filter( -// cand.paidOn.eq(q.parameter("paidOn", LocalDateTime.class) -// ) -// ); -// return q.setParameter("paidOn", null) -// .executeList(); -//} -//---- -// -//* Extend `PetOwnerBuilderScript` so that all but the last `Visit` for each ``PetOwner``'s ``Pet``s has been paid. -//+ -//Add some further supporting methods: -//+ -//[source,java] -//---- -//private String someDiagnosis() { -// return fakeDataService.lorem().paragraph(fakeDataService.ints().between(1, 3)); -//} -// -//private BigDecimal someCost() { -// return new BigDecimal(20.00 + fakeDataService.doubles().upTo(30.00d)); -//} -//---- -//+ -//In the `execute(...)`, update the `for` loop so that all ``Visit``s have an outcome and all but the last (for each ``PetOwner``) has been paid: -//+ -//[source,java] -//---- -//for (int i = 0; i < petDatum.numberOfVisits; i++) { -// ... -// LocalDateTime someTimeInPast = ... -// Visit visit = ... -// wrap(visit).enterOutcome(someDiagnosis(), someCost()); -// if(i != petDatum.numberOfVisits - 1) { -// setTimeTo(ec, someTimeInPast.plusDays(fakeDataService.ints().between(10,30))); -// wrap(visit).paid(); -// } -//} -//---- -// -// -//== Prevent payment for a visit twice -// -//We've already seen that it's possible to validate arguments to actions; for example that a `Visit` can only be booked in the future. -//But if a `Visit` has already been paid for, then we don't want the user to be able to even attempt to invoke the action. -// -//The framework provides three different types of pre-condition checks: -// -//* "See it?" - should the action/property be visible at all, or has it been hidden? -// -//* "Use it" - if visible, then can the action/property be used or has it been disabled (greyed out) -// -//* "Do it" - if the action/property is ok to be used (action invoked/property edited) then are the proposed action arguments or new property value valid, or are they invalid? -// -//Or in other words, "see it, use it, do it". -// -//As with validation, disablement can be defined either declaratively (annotations) or imperatively (supporting methods). -//Let's see how an imperative supporting method can be used to implement this particular requirement (that a visit can't be paid for twice). -// -//=== Solution -// -//[source,bash,subs="attributes+"] -//---- -//git checkout tags/{tag-version}/350-prevent-payment-for-a-visit-twice -//mvn clean package jetty:run -//---- -// -// -//=== Exercise -// -//* update `Visit_pay_IntegTest` to ensure cannot enter into the `paidOn` property directly: -//+ -//[source,java] -//---- -//@Test -//public void cannot_edit_paidOn_directly() { -// -// // expecting -// expectedExceptions.expect(DisabledException.class); -// expectedExceptions.expectMessage("Use 'paid on' action"); -// -// // when -// wrap(visit).setPaidOn(clockService.now()); -//} -//---- -// -//* now, add in the test that asserts that a `Visit` cannot be paid more than once: -//+ -//[source,java] -//---- -//@Test -//public void cannot_pay_more_than_once() { -// -// // given -// wrap(visit).paid(); -// assertThat(visits.findNotPaid()).asList().doesNotContain(visit); -// -// // expecting -// expectedExceptions.expect(DisabledException.class); -// expectedExceptions.expectMessage("Already paid"); -// -// // when -// wrap(visit).paid(); -//} -//---- -// -//* and finally update `Visit`. -//This is done using a supporting method. -//+ -//[source,java] -//---- -//public String disablePaid() { -// return getPaidOn() != null ? "Already paid": null; -//} -//---- -// -// -//== Find ``Visit``s not yet paid and overdue -// -//In the previous scenario we implemented `Visits#findNotPaid()`. -//Since this is pretty important information, let's surface that to the end-user by adding it to the home page dashboard. -// -//We could also go a little further by allowing the user to use the dashboard to update visits that have been paid. -//This is a good example of how a view model can support specific business processes, in this case saving the end-user from having to navigate down to each and every one of the ``Visit``s. -// -//=== Solution -// -//[source,bash,subs="attributes+"] -//---- -//git checkout tags/{tag-version}/360-find-visits-not-yet-paid-and-overdue -//mvn clean package jetty:run -//---- -// -//image::Dashboard-overdue.png[width="800px",link="_images/Dashboard-overdue.png"] -// -//=== Exercise -// -// -//* update `Dashboard`: -//+ -//[source,java] -//---- -//@CollectionLayout(defaultView = "table") -//public List<Visit> getOverdue() { -// List<Visit> notPaid = visits.findNotPaid(); -// LocalDateTime thirtyDaysAgo = clockService.nowAsLocalDateTime().minusDays(30); -// return notPaid.stream() -// .filter(x -> x.getVisitAt().isBefore(thirtyDaysAgo)) // <1> -// .collect(Collectors.toList()); -//} -// -//@Action(semantics = SemanticsOf.IDEMPOTENT, associateWith = "overdue") // <2> -//public Dashboard paid(List<Visit> visits) { -// for (Visit visit : visits) { -// if(visit.getPaidOn() == null) { -// visit.paid(); -// } -// } -// return this; -//} -// -//@javax.inject.Inject -//Visits visits; -// -//@javax.inject.Inject -//ClockService clockService; -//---- -//<1> An alternative (better?) design would have been to add a new query method in `Visits` to find those overdue, avoiding the client-side filtering that we see above. -//<2> The "associateWith" annotation results in checkboxes alongside the "overdue" collection, with the collection providing the set of values for the parameter. -// -// -//* update `Dashboard.layout.xml` also -// -//* write a new `Dashboard_paid_IntegTest` integration test: -//+ -//[source,java] -//---- -//public class Dashboard_paid_IntegTest extends PetClinicModuleIntegTestAbstract { -// -// Dashboard dashboard; -// -// @Before -// public void setup() { -// // given -// runFixtureScript(new PersonaEnumPersistAll<>(Owner_enum.class)); -// dashboard = homePageProvider.dashboard(); -// } -// -// @Test -// public void happy_case() { -// -// // given -// List<Visit> overdue = dashboard.getOverdue(); -// assertThat(overdue).isNotEmpty(); -// -// // when -// wrap(dashboard).paid(overdue); -// -// // then -// List<Visit> overdueAfter = dashboard.getOverdue(); -// assertThat(overdueAfter).isEmpty(); -// -// for (Visit visit : overdue) { -// assertThat(visit.getDiagnosis()).isNotNull(); -// assertThat(visit.getPaidOn()).isNotNull(); -// } -// } -// -// @Inject -// HomePageProvider homePageProvider; -//} -//---- -// -//* Running the integration test at this point will produce a null pointer exception. -//That's because the framework has had no opportunity to inject any domain services into the `Dashboard`. -//+ -//Under normal runtime cases this doesn't matter because the only caller of the method is the framework itself, and when the domain object is rendered the framework will automatically ensure that any domain sevices are injected. -//+ -//In an integration test this doesn't occur, and so we need to manually inject the services. -//It makes most sense to do this in `HomePageProvider`; we use the framework-provided `ServiceRegistry2` domain service: -//+ -//[source,java] -//---- -//@HomePage -//public Dashboard dashboard() { -// return serviceRegistry2.injectServicesInto(new Dashboard()); -//} -//@Inject -//ServiceRegistry2 serviceRegistry2; -//---- -// -// -// -//== Digression: Hiding Columns in Tables -// -//We could improve the dashboard a little. -//After all, in the "overdue" collection there's no point in showing the "paidOn"; the value will always be null. -//Also, the "reason" column is also somewhat superfluous (as, arguably, is the "diagnosis" column): -// -//image::Dashboard-overdue-ui-hints.png[width="800px",link="_images/Dashboard-overdue-ui-hints.png"] -// -//The framework offers two different ways to address this, so we'll show both. -// -//=== Solution -// -//[source,bash,subs="attributes+"] -//---- -//git checkout tags/{tag-version}/370-digression-hiding-columns-in-tables -//mvn clean package jetty:run -//---- -// -// -//=== Exercise -// -//* The first technique is within the Java code; one could think of this as an implication within the "application layer". -//+ -//We use a domain service that implements `TableColumnOrderService` as an SPI to "advise" the framework on how to render the collection. -//Traditionally such classes are implemented as a nested static class, in this case of `Dashboard`: -//+ -//[source,java] -//---- -//@DomainService(nature = NatureOfService.DOMAIN) -//public static class RemovePaidOnFromOverdue extends TableColumnOrderService.Default { -// @Override -// public List<String> orderParented( -// final Object parent, -// final String collectionId, -// final Class<?> collectionType, -// final List<String> propertyIds) { -// if (parent instanceof Dashboard && "overdue".equalsIgnoreCase(collectionId)) { -// propertyIds.remove("paidOn"); -// } -// return propertyIds; -// } -//} -//---- -//+ -//The above code removes the "paidOn" column. -// -//* The second technique is to exploit the fact that the HTML generated by the framework is liberally annotated with domain class identifiers. -//The column can therefore be removed by supplying the appropriate CSS. -//We could think of this as an implementation within the presentation layer. -//+ -//In the `src/main/webapp/css/application.css` file, add: -//+ -//[source,css] -//---- -//.domainapp-modules-impl-dashboard-Dashboard .entityCollection .overdue .Visit-reason { -// display: none; -//} -//---- -// -// -// -//== Another Digression: Icons and CSS -// -//In the same way that titles can be specified imperatively, so too can icons, using the `iconName()` method. -//One use case is for a domain object that has several states: the `iconName()` defines a suffix which is used to lookup different icons (eg "ToDoItem-notDone.png" and "ToDoItem-done.png"). -// -//Similarly, it's possible to specify CSS hints imperatively using the `cssClass()`. -//This returns a simple string that is added as a CSS class wherever the object is rendered in the UI. -// -//In this exercise we'll use a different icon for the various species of `Pet`: -// -//image::Pet-icons.png[width="800px",link="_images/Pet-icons.png"] -// -//Let's also use a strike-through text for all ``Visit``s that are paid when rendered within a collection: -// -//image::Visits-paid-strikethrough.png[width="800px",link="_images/Visits-paid-strikethrough.png"] -// -// -// -// -//=== Solution -// -//[source,bash,subs="attributes+"] -//---- -//git checkout tags/{tag-version}/380-another-digression-icons-and-css -//mvn clean package jetty:run -//---- -// -// -// -//=== Exercise -// -//For the icons: -// -//* add new icons for each of the pet species: `Pet-dog.png`, `Pet-cat.png`, `Pet-hamster.dog` and `Pet-budgerigar.png` -// -//* add an `iconName()` method to `Pet`: -//+ -//[source,java] -//---- -//public String iconName() { -// return getPetSpecies().name().toLowerCase(); -//} -//---- -// -// -//For the CSS class: -// -//* add a `cssClass()` method to `Visit`: -//+ -//[source,java] -//---- -//public String cssClass() { -// boolean isPaid = getPaidOn() != null; -// return isPaid ? "paid": null; -//} -//---- -// -// -//* update `application.css`: -// -//[source,css] -//---- -//.entityCollection .domainapp-modules-impl-visits-dom-Visit .paid { -// text-decoration: line-through; -// color: lightgrey; -//} -//---- -// -// -//== Delete an `PetOwner` provided no unpaid ``Visit``s -// -//=== Solution -// -//[source,bash,subs="attributes+"] -//---- -//git checkout tags/{tag-version}/390-delete-an-owner-provided-no-unpaid-visits -//mvn clean package jetty:run -//---- -// -// -//=== Exercise -// -//We don't want `PetOwner` (in the `pets` module) to check for unpaid ``Visit``s, because that would create a cyclic dependency between modules. -//Instead, we'll use a subscriber in the `visits` module which can veto any attempt to delete an owner if there are unpaid visits. -// -//For this, we arrange for the `PetOwner` to emit an action domain event when its `delete()` action is invoked. -//In fact, the event will be emitted by the framework up to five times: to check if the action is visible, if it is disabled, if it's valid, pre-execute and post-execute. -//The subscriber in the ``visits`` module will therefore potentially veto on the disable phase. -// -//* in the `Visits` repository, add `findNotPaidBy` method to find any unpaid ``Visit``s for an `PetOwner`: -//+ -//[source,java] -//---- -//@Programmatic -//public java.util.List<Visit> findNotPaidBy(Owner owner) { -// TypesafeQuery<Visit> q = causewayJdoSupport.newTypesafeQuery(Visit.class); -// final QVisit cand = QVisit.candidate(); -// q = q.filter( -// cand.paidOn.eq(q.parameter("paidOn", LocalDateTime.class) -// ).and( -// cand.pet.owner.eq(q.parameter("owner", Owner.class)) -// ) -// ); -// return q.setParameter("paidOn", null) -// .setParameter("owner", owner) -// .executeList(); -//} -//---- -// -//* update `PetOwner`'s `delete()` action so that it emits an action domain event. -//+ -//[source,java] -//---- -//import org.apache.causeway.applib.services.eventbus.ActionDomainEvent; -//... -//public static class Delete extends ActionDomainEvent<Owner> {} // <1> -//@Action( -// domainEvent = Delete.class // <2> -// semantics = SemanticsOf.NON_IDEMPOTENT // <3> -//) -//public void delete() { -// final String title = titleService.titleOf(this); -// messageService.informUser(String.format("'%s' deleted", title)); -// repositoryService.removeAndFlush(this); -//} -//---- -//<1> declare the event, and -//<2> emit it -//<3> change from `NON_IDEMPOTENT_ARE_YOU_SURE` (due to a bug in the framework). -// -//* add a new integration test: -//+ -//[source,java] -//---- -//public class Owner_delete_IntegTest extends PetClinicModuleIntegTestAbstract { -// -// @Test -// public void can_delete_if_there_are_no_unpaid_visits() { -// -// // given -// runFixtureScript(Owner_enum.FRED_HUGHES.builder()); -// -// Owner owner = Owner_enum.FRED_HUGHES.findUsing(serviceRegistry); -// List<Visit> any = visits.findNotPaidBy(owner); -// assertThat(any).isEmpty(); -// -// // when -// wrap(owner).delete(); -// -// // then -// Owner ownerAfter = Owner_enum.FRED_HUGHES.findUsing(serviceRegistry); -// assertThat(ownerAfter).isNull(); -// } -// -// @Test -// public void cannot_delete_with_unpaid_visits() { -// -// // given -// runFixtureScript(Owner_enum.MARY_JONES.builder()); -// -// Owner owner = Owner_enum.MARY_JONES.findUsing(serviceRegistry); -// List<Visit> any = visits.findNotPaidBy(owner); -// assertThat(any).isNotEmpty(); -// -// // expect -// expectedExceptions.expect(DisabledException.class); -// expectedExceptions.expectMessage("This owner still has unpaid visit(s)"); -// -// // when -// wrap(owner).delete(); -// } -// -// @Inject -// Visits visits; -//} -//---- -// -//* add the subscriber to veto the action if required: -//+ -//[source,java] -//---- -//@DomainService(nature = NatureOfService.DOMAIN) -//public class VetoDeleteOfOwnerWithUnpaidVisits -// extends org.apache.causeway.applib.AbstractSubscriber { -// -// @org.axonframework.eventhandling.annotation.EventHandler -// public void on(Owner.Delete ev) { -// -// switch (ev.getEventPhase()) { -// case DISABLE: -// Collection<Visit> visitsForPet = visits.findNotPaidBy(ev.getSource()); -// if (!visitsForPet.isEmpty()) { -// ev.veto("This owner still has unpaid visit(s)"); -// } -// break; -// } -// } -// -// @javax.inject.Inject -// Visits visits; -//} -//---- -// -//* finally, in `PetClinicModuleIntegTestAbstract`, we need to make a small adjustment to use the same event bus implementation as the production app: -//+ -//[source,java] -//---- -//super(new PetClinicModule() -// .withAdditionalServices(DeploymentCategoryProviderForTesting.class) -// .withConfigurationProperty("causeway.services.eventbus.implementation","axon") // <1> -// .withConfigurationProperty(TranslationServicePo.KEY_PO_MODE, "write") -//); -//---- -//<1> specify Axon as the event bus implementation -// -// -// -// 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 25feb8399e3..00dc4edc826 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-entities/jpa.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-entities/jpa.adoc @@ -122,24 +122,16 @@ These are used by repository domain services to query for instances of the entit [source,java] ---- -... [email protected]({ - @javax.persistence.NamedQuery( // <.> - name = "findByNameLike", // <.> - query = "SELECT so " + // <.> - "FROM SimpleObject so " + - "WHERE so.name LIKE :name" - ) -}) +import jakarta.persistence.*; [email protected]({ - @javax.jdo.annotations.Query( // <.> - name = "findByName", // <.> - value = "SELECT " // <.> - + "FROM domainapp.modules.simple.dom.impl.SimpleObject " // <.> - + "WHERE name.indexOf(:name) >= 0 ") // <.> +@NamedQueries({ + @NamedQuery( // <.> + name = "SimpleObject.findByNameLike", // <.> + query = "SELECT so " + // <.> + "FROM SimpleObject so " + + "WHERE so.name LIKE :name" + ) }) -... public class SimpleObject { /* ... */ } ---- <.> There may be several `@NamedQuery` annotations, nested within a `@NamedQueries` annotation) defines queries using JPAQL. diff --git a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc index b7f00dc298a..705918793d4 100644 --- a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc +++ b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/actions.adoc @@ -178,7 +178,7 @@ For example: [source,java] ---- -import javax.jdo.annotations.Column; +import jakarta.persistence.Column; import lombok.Getter; import lombok.Setter; import org.joda.time.LocalDate; @@ -186,15 +186,15 @@ import org.joda.time.LocalDate; @Action(semantics=SemanticsOf.IDEMPOTENT) public Order invoice( PaymentMethodType paymentMethodType, - @Nullable // <.> + @Nullable // <.> @ParameterLayout(named="Ship no later than") LocalDate shipBy) { - ... + // ... setShipBy(shipBy) return this; } -@Column(nullable=true) // <.> +@Column(nullable=true) // <.> @Property @Getter @Setter private LocalDate shipBy; @@ -204,7 +204,6 @@ private LocalDate shipBy; + Note that this uses an ORM-specific mechanism to specify the same semantics (in this case, using xref:pjpa:ROOT:about.adoc[JPA/Eclipselink]' `@Column#nullable()`.) -See also xref:userguide:ROOT:meta-annotations.adoc#properties-vs-parameters[properties vs parameters]. == ``String`` Parameters (Length) @@ -260,7 +259,7 @@ For example: [source,java] ---- -import javax.jdo.annotations.Column; +import jakarta.persistence.Column; import lombok.Getter; import lombok.Setter; @@ -281,7 +280,6 @@ private BigDecimal discountRate; + Note that this uses an ORM-specific annotation (in this case, xref:refguide:applib-ant:Column.adoc#lengthscale-for-bigdecimals[@Column#scale] -See also xref:userguide:ROOT:meta-annotations.adoc#properties-vs-parameters[properties vs parameters]. 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 c815a5dca74..3c1f8db31dc 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 @@ -213,8 +213,8 @@ int maxLength() * Indicates whether the property should be included or excluded from mementos. * * <p> - * To ensure that the property is actually not persisted in the objectstore, also annotate with the JDO annotation - * <code>javax.jdo.annotations.NotPersistent</code> + * To ensure that the property is actually not persisted in the JPA object store, also annotate with + * {@link jakarta.persistence.Transient}. * </p> */ Snapshot snapshot() diff --git a/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCache.java b/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCache.java index b910486ffae..ed101ad7bbd 100644 --- a/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCache.java +++ b/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCache.java @@ -287,13 +287,6 @@ public boolean hasJaxbRootElementSemantics() { return hasAnnotation(XmlRootElement.class); } - /** - * whether type is JDO persistable (but NOT embedded only) - */ - public boolean isJdoPersistenceCapable() { - return _ClassCacheUtil.isJdoPersistenceCapable(mergedAnnotations) - && !_ClassCacheUtil.isJdoEmbeddedOnly(mergedAnnotations); - } public Can<String> springProfiles() { var profileAnnot = mergedAnnotations.get(Profile.class); diff --git a/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCacheUtil.java b/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCacheUtil.java index 9ade2ccb91b..3a3241f140f 100644 --- a/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCacheUtil.java +++ b/commons/src/main/java/org/apache/causeway/commons/internal/reflection/_ClassCacheUtil.java @@ -43,9 +43,9 @@ class _ClassCacheUtil { if(!_Strings.isEmpty(named)) return named; for(var annot : mergedAnnotations) { + //noinspection SwitchStatementWithTooFewBranches switch (annot.getType().getName()) { - case "jakarta.persistence.Table": - case "javax.jdo.annotations.PersistenceCapable": { + case "jakarta.persistence.Table": { var schema = annot.getString("schema"); if(_Strings.isEmpty(schema)) continue; @@ -58,29 +58,6 @@ class _ClassCacheUtil { return null; } - boolean isJdoPersistenceCapable(final MergedAnnotations mergedAnnotations) { - for(var annot : mergedAnnotations) { - switch (annot.getType().getName()) { - case "javax.jdo.annotations.PersistenceCapable": - return true; - } - } - return false; - } - - boolean isJdoEmbeddedOnly(final MergedAnnotations mergedAnnotations) { - for(var annot : mergedAnnotations) { - switch (annot.getType().getName()) { - case "javax.jdo.annotations.PersistenceCapable": - if("true".equals(annot.getString("embeddedOnly"))) return true; - break; - case "javax.jdo.annotations.EmbeddedOnly": - return true; - } - } - return false; - } - @Nullable private String nameFromPersistenceTable(final Class<?> type, final @Nullable String schema, final @Nullable String table) { if(_Strings.isEmpty(schema)) return null; diff --git a/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifier.java b/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifier.java index acd39d2b8f2..03b8de75134 100644 --- a/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifier.java +++ b/core/config/src/main/java/org/apache/causeway/core/config/beans/CausewayBeanTypeClassifier.java @@ -142,9 +142,6 @@ public CausewayBeanMetaData classify(final @NonNull LogicalType logicalType, fin } // entity support - if(typeHead.isJdoPersistenceCapable()){ - return CausewayBeanMetaData.entity(named.get(), discoveredBy, PersistenceStack.JDO); - } if(typeHead.hasAnnotation(Entity.class)) { return CausewayBeanMetaData.entity(named.get(), discoveredBy, PersistenceStack.JPA); } diff --git a/extensions/core/excel/fixture/src/main/java/org/apache/causeway/extensions/excel/fixtures/demoapp/todomodule/dom/ExcelDemoToDoItem.java b/extensions/core/excel/fixture/src/main/java/org/apache/causeway/extensions/excel/fixtures/demoapp/todomodule/dom/ExcelDemoToDoItem.java index 1447911aab3..d50bddc42e6 100644 --- a/extensions/core/excel/fixture/src/main/java/org/apache/causeway/extensions/excel/fixtures/demoapp/todomodule/dom/ExcelDemoToDoItem.java +++ b/extensions/core/excel/fixture/src/main/java/org/apache/causeway/extensions/excel/fixtures/demoapp/todomodule/dom/ExcelDemoToDoItem.java @@ -63,55 +63,8 @@ @Entity @Table( - //identityType=IdentityType.DATASTORE, schema = "libExcelFixture" ) -//FIXME -//@javax.jdo.annotations.Version( -// strategy=VersionStrategy.VERSION_NUMBER, -// column="version") -//@javax.jdo.annotations.Uniques({ -// @javax.jdo.annotations.Unique( -// name="ToDoItem_description_must_be_unique", -// members={"ownedBy","description"}) -//}) -//@javax.jdo.annotations.Queries( { -// @javax.jdo.annotations.Query( -// name = "todo_all", language = "JDOQL", -// value = "SELECT " -// + "FROM " + ExcelDemoToDoItem.FQCN + " " -// + "WHERE ownedBy == :ownedBy"), -// @javax.jdo.annotations.Query( -// name = "todo_notYetComplete", language = "JDOQL", -// value = "SELECT " -// + "FROM " + ExcelDemoToDoItem.FQCN + " " -// + "WHERE ownedBy == :ownedBy " -// + " && complete == false"), -// @javax.jdo.annotations.Query( -// name = "findByDescription", language = "JDOQL", -// value = "SELECT " -// + "FROM " + ExcelDemoToDoItem.FQCN + " " -// + "WHERE ownedBy == :ownedBy " -// + " && description == :description"), -// @javax.jdo.annotations.Query( -// name = "todo_complete", language = "JDOQL", -// value = "SELECT " -// + "FROM " + ExcelDemoToDoItem.FQCN + " " -// + "WHERE ownedBy == :ownedBy " -// + "&& complete == true"), -// @javax.jdo.annotations.Query( -// name = "todo_similarTo", language = "JDOQL", -// value = "SELECT " -// + "FROM " + ExcelDemoToDoItem.FQCN + " " -// + "WHERE ownedBy == :ownedBy " -// + "&& category == :category"), -// @javax.jdo.annotations.Query( -// name = "todo_autoComplete", language = "JDOQL", -// value = "SELECT " -// + "FROM " + ExcelDemoToDoItem.FQCN + " " -// + "WHERE ownedBy == :ownedBy && " -// + "description.indexOf(:description) >= 0") -//}) @DomainObject( autoCompleteRepository = ExcelDemoToDoItemMenu.class ) diff --git a/extensions/vw/pdfjs/fixtures/.gitignore b/extensions/vw/pdfjs/fixtures/.gitignore deleted file mode 100644 index 262b1fa4ef7..00000000000 --- a/extensions/vw/pdfjs/fixtures/.gitignore +++ /dev/null @@ -1 +0,0 @@ -translations.pot diff --git a/extensions/vw/pdfjs/fixtures/pom.xml b/extensions/vw/pdfjs/fixtures/pom.xml deleted file mode 100644 index d85e2c7721d..00000000000 --- a/extensions/vw/pdfjs/fixtures/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -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. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.causeway.extensions</groupId> - <artifactId>causeway-extensions-pdfjs</artifactId> - <version>${revision}</version> - </parent> - - <groupId>org.causewayaddons.wicket.pdfjs</groupId> - <artifactId>causeway-extensions-pdfjs-fixtures</artifactId> - <name>Apache Causeway Ext - Wicket Viewer - pdf.js (fixtures)</name> - - <dependencies> - <dependency> - <groupId>org.apache.causeway.core</groupId> - <artifactId>causeway-applib</artifactId> - </dependency> - - <dependency> - <groupId>org.hsqldb</groupId> - <artifactId>hsqldb</artifactId> - </dependency> - - - <dependency> - <groupId>org.togglz</groupId> - <artifactId>togglz-core</artifactId> - </dependency> - - <dependency> - <groupId>org.jdom</groupId> - <artifactId>jdom2</artifactId> - </dependency> - - <!-- test --> - <dependency> - <groupId>org.togglz</groupId> - <artifactId>togglz-junit</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - <scope>provided</scope> - </dependency> - - </dependencies> - -</project> diff --git a/extensions/vw/pdfjs/fixtures/src/main/java/META-INF/persistence.xml b/extensions/vw/pdfjs/fixtures/src/main/java/META-INF/persistence.xml deleted file mode 100644 index 72b8f821c23..00000000000 --- a/extensions/vw/pdfjs/fixtures/src/main/java/META-INF/persistence.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - 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. ---> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> - - <persistence-unit name="org-causewayaddons-module-pdfjs-fixture"> - </persistence-unit> -</persistence> diff --git a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/PdfjsFixturesModule.java b/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/PdfjsFixturesModule.java deleted file mode 100644 index e24db74100c..00000000000 --- a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/PdfjsFixturesModule.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.causewayaddons.wicket.pdfjs.fixture; - -import jakarta.xml.bind.annotation.XmlRootElement; - -import org.apache.causeway.applib.fixturescripts.FixtureScript; -import org.apache.causeway.testing.fixtures.applib.modules.ModuleWithFixtures; - -import org.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.fixturescripts.PdfJsDemoObjectWithBlob_tearDown; - -@XmlRootElement(name = "module") -public class PdfjsFixturesModule implements ModuleWithFixtures { - - @Override public FixtureScript getTeardownFixture() { - return new PdfJsDemoObjectWithBlob_tearDown(); - } - -} diff --git a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/dom/PdfJsDemoObjectWithBlob.java b/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/dom/PdfJsDemoObjectWithBlob.java deleted file mode 100644 index 8c612a3a4d3..00000000000 --- a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/dom/PdfJsDemoObjectWithBlob.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.dom; - -import java.net.MalformedURLException; -import java.net.URL; - -import javax.jdo.annotations.IdGeneratorStrategy; -import javax.jdo.annotations.IdentityType; -import javax.jdo.annotations.VersionStrategy; - -import org.wicketstuff.pdfjs.Scale; - -import org.apache.causeway.applib.annotation.Action; -import org.apache.causeway.applib.annotation.BookmarkPolicy; -import org.apache.causeway.applib.annotation.DomainObject; -import org.apache.causeway.applib.annotation.DomainObjectLayout; -import org.apache.causeway.applib.annotation.Editing; -import org.apache.causeway.applib.annotation.MemberOrder; -import org.apache.causeway.applib.annotation.MemberSupport; -import org.apache.causeway.applib.annotation.Optionality; -import org.apache.causeway.applib.annotation.Property; -import org.apache.causeway.applib.annotation.PropertyLayout; -import org.apache.causeway.applib.annotation.SemanticsOf; -import org.apache.causeway.applib.annotation.Title; -import org.apache.causeway.applib.annotation.Where; -import org.apache.causeway.applib.value.Blob; - -import org.causewayaddons.wicket.pdfjs.cpt.applib.PdfJsViewer; - -import lombok.Getter; -import lombok.Setter; - [email protected]( - identityType=IdentityType.DATASTORE, - schema = "wktPdfjsFixture" -) [email protected](strategy= IdGeneratorStrategy.IDENTITY, column = "id") [email protected](strategy=VersionStrategy.VERSION_NUMBER, column = "version") -@DomainObject -@DomainObjectLayout( - bookmarking = BookmarkPolicy.AS_ROOT, - cssClassUiEvent = PdfJsDemoObjectWithBlob.CssClassUiEvent.class -) -public class PdfJsDemoObjectWithBlob implements Comparable<PdfJsDemoObjectWithBlob> { - - public static class CssClassUiEvent - extends org.apache.causeway.applib.services.eventbus.CssClassUiEvent<PdfJsDemoObjectWithBlob> {} - - @javax.jdo.annotations.Column(allowsNull="false") - @Title(sequence="1") - @Property(editing = Editing.ENABLED) - @Getter @Setter - private String name; - - @PropertyLayout(group = "name", sequence = "1") - public PdfJsDemoObjectWithBlob updateName(String name) { - setName(name); - return this; - } - @MemberSupport public String default0UpdateName() { - return getName(); - } - - @javax.jdo.annotations.Column(allowsNull="true") - @Property(editing = Editing.ENABLED) - @Getter @Setter - private String url; - - @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = { - @javax.jdo.annotations.Column(name = "blob_name"), - @javax.jdo.annotations.Column(name = "blob_mimetype"), - @javax.jdo.annotations.Column(name = "blob_bytes", jdbcType = "BLOB", sqlType = "LONGVARBINARY") - }) - @Property(optionality = Optionality.OPTIONAL, editing = Editing.ENABLED) - @PropertyLayout(hidden = Where.ALL_TABLES) - @Setter - private Blob blob; - - // @Getter(onMethod = @__({ })) throwing a compile exception :-( - @PdfJsViewer(initialPageNum = 1, initialScale = Scale._1_00, initialHeight = 600) - public Blob getBlob() { - return blob; - } - - @Action(semantics = SemanticsOf.SAFE) - @PropertyLayout(group = "url", sequence = "1") - public URL openUrl() throws MalformedURLException { - return new java.net.URL(getUrl()); - } - @MemberSupport public String disableOpenUrl() { - if (getUrl() == null) - return "No URL to open"; - return null; - } - - @Override - public String toString() { - return getName(); - } - - @Override - public int compareTo(final PdfJsDemoObjectWithBlob other) { - return Ordering.natural().onResultOf(PdfJsDemoObjectWithBlob::getName).compare(this, other); - } - -} diff --git a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/dom/PdfJsDemoObjectWithBlobMenu.java b/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/dom/PdfJsDemoObjectWithBlobMenu.java deleted file mode 100644 index 9720c0fe4d0..00000000000 --- a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/dom/PdfJsDemoObjectWithBlobMenu.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.dom; - -import java.util.List; - -import jakarta.inject.Named; - -import org.apache.causeway.applib.annotation.Action; -import org.apache.causeway.applib.annotation.ActionLayout; -import org.apache.causeway.applib.annotation.BookmarkPolicy; -import org.apache.causeway.applib.annotation.DomainService; -import org.apache.causeway.applib.annotation.DomainServiceLayout; -import org.apache.causeway.applib.annotation.MemberOrder; -import org.apache.causeway.applib.annotation.ParameterLayout; -import org.apache.causeway.applib.annotation.SemanticsOf; -import org.apache.causeway.applib.services.repository.RepositoryService; - -@Named("wktPdfJsFixture.PdfJsDemoObjectWithBlobMenu") -@DomainService -@DomainServiceLayout( - named = "Demo", - menuOrder = "10.4" -) [email protected](PriorityPrecedence.EARLY) -@RequiredArgsConstructor(onConstructor_ = { @Inject }) -public class PdfJsDemoObjectWithBlobMenu { - - final RepositoryService repositoryService; - - @Action( - semantics = SemanticsOf.SAFE - ) - @ActionLayout( - bookmarking = BookmarkPolicy.AS_ROOT - ) - @MemberOrder(sequence = "1") - public List<PdfJsDemoObjectWithBlob> listAllDemoObjectsWithBlob() { - return repositoryService.allInstances(PdfJsDemoObjectWithBlob.class); - } - - @MemberOrder(sequence = "2") - public PdfJsDemoObjectWithBlob createDemoObjectWithBlob( - @ParameterLayout(named = "Name") - final String name) { - final PdfJsDemoObjectWithBlob obj = repositoryService.instantiate(PdfJsDemoObjectWithBlob.class); - obj.setName(name); - repositoryService.persist(obj); - return obj; - } - -} diff --git a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/fixturescripts/PdfJsDemoObjectWithBlob_createUpTo5_fakeData.java b/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/fixturescripts/PdfJsDemoObjectWithBlob_createUpTo5_fakeData.java deleted file mode 100644 index 239730c9266..00000000000 --- a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/fixturescripts/PdfJsDemoObjectWithBlob_createUpTo5_fakeData.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.fixturescripts; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.List; - -import jakarta.activation.MimeType; -import jakarta.activation.MimeTypeParseException; - -import org.apache.causeway.applib.fixturescripts.FixtureScript; -import org.apache.causeway.applib.value.Blob; - -import org.causewayaddons.module.fakedata.dom.FakeDataService; -import org.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.dom.PdfJsDemoObjectWithBlob; -import org.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.dom.PdfJsDemoObjectWithBlobMenu; - -import lombok.Getter; - -public class PdfJsDemoObjectWithBlob_createUpTo5_fakeData extends FixtureScript { - - @import jakarta.inject.Inject - PdfJsDemoObjectWithBlobMenu demoObjectMenu; - - @import jakarta.inject.Inject - FakeDataService fakeDataService; - - @Getter - private Integer number ; - public PdfJsDemoObjectWithBlob_createUpTo5_fakeData setNumber(final Integer number) { - this.number = number; - return this; - } - - @Getter - private List<PdfJsDemoObjectWithBlob> demoObjects = Lists.newArrayList(); - - @Override - protected void execute(final ExecutionContext ec) { - - defaultParam("number", ec, 3); - if(getNumber() < 1 || getNumber() > 5) { - // there are 5 sample PDFs - throw new IllegalArgumentException("number of demo objects to create must be within [1,5]"); - } - - for (int i = 0; i < getNumber(); i++) { - final PdfJsDemoObjectWithBlob demoObject = create(i, ec); - getDemoObjects().add(demoObject); - } - } - - private PdfJsDemoObjectWithBlob create(final int n, final ExecutionContext ec) { - final String name = fakeDataService.name().firstName(); - - final String documentName = "Sample" + (n + 1) + ".PDF"; - final String urlStr = "http://www.pdfpdf.com/samples/" + documentName; - - Blob blob = asBlob(documentName, urlStr); - - final PdfJsDemoObjectWithBlob demoObject = wrap(demoObjectMenu).createDemoObjectWithBlob(name); - wrap(demoObject).setUrl(urlStr); - wrap(demoObject).setBlob(blob); - - return ec.addResult(this, demoObject); - } - - private Blob asBlob(final String documentName, final String urlStr) { - try { - final URL url = new URL(urlStr); - - final HttpURLConnection httpConn = openConnection(url); - final String contentType = httpConn.getContentType(); - final MimeType mimeType = determineMimeType(contentType); - - httpConn.disconnect(); - - final ByteSource byteSource = Resources.asByteSource(url); - final byte[] bytes = byteSource.read(); - - return new Blob(documentName, mimeType.getBaseType(), bytes); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private HttpURLConnection openConnection(final URL url) throws IOException { - final HttpURLConnection httpConn = (HttpURLConnection) url.openConnection(); - final int responseCode = httpConn.getResponseCode(); - if (responseCode != HttpURLConnection.HTTP_OK) { - throw new RuntimeException("Response code: " + responseCode); - } - return httpConn; - } - - private MimeType determineMimeType(final String contentType) throws MimeTypeParseException { - final String mimeType = parseMimeType(contentType); - if(mimeType == null) { - return null; - } - return new MimeType(mimeType); - } - - // text/plain; charset=UTF-8 - private String parseMimeType(final String contentType) { - final Iterable<String> values = Splitter.on(";").split(contentType); - for (String value : values) { - // is simply the first part - return value.trim(); - } - - return null; - } - -} diff --git a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/fixturescripts/PdfJsDemoObjectWithBlob_tearDown.java b/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/fixturescripts/PdfJsDemoObjectWithBlob_tearDown.java deleted file mode 100644 index 7a91b622a0f..00000000000 --- a/extensions/vw/pdfjs/fixtures/src/main/java/org/causewayaddons/wicket/pdfjs/fixture/demoapp/demomodule/fixturescripts/PdfJsDemoObjectWithBlob_tearDown.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.fixturescripts; - -import org.apache.causeway.applib.fixturescripts.teardown.TeardownFixtureAbstract2; - -import org.causewayaddons.wicket.pdfjs.fixture.demoapp.demomodule.dom.PdfJsDemoObjectWithBlob; - -public class PdfJsDemoObjectWithBlob_tearDown extends TeardownFixtureAbstract2 { - - @Override - protected void execute(final ExecutionContext executionContext) { - deleteFrom(PdfJsDemoObjectWithBlob.class); - } - -} diff --git a/starters/adoc/modules/starters/pages/helloworld.adoc b/starters/adoc/modules/starters/pages/helloworld.adoc index 458213ca3e2..d1f6736e242 100644 --- a/starters/adoc/modules/starters/pages/helloworld.adoc +++ b/starters/adoc/modules/starters/pages/helloworld.adoc @@ -317,8 +317,7 @@ The `jpa` branch also has the `HelloWorldRepository` Spring Data service. * all entities. + -These are entities that are annotated with both xref:refguide:applib:index/annotation/DomainObject.adoc[@DomainObject] annotation and with the ORM-specific annotation. -For `jdo` branch, this is `@javax.jdo.annotations.PersistenceCapable`; for the `jpa` branch this is `@javax.persistence.Entity`). +These are entities that are annotated with both xref:refguide:applib:index/annotation/DomainObject.adoc[@DomainObject] annotation and with the JPA `@jakarta.persistence.Entity` annotation. + In the helloworld starter app, the only entity is `HelloWorldObject`. diff --git a/starters/adoc/modules/starters/pages/simpleapp.adoc b/starters/adoc/modules/starters/pages/simpleapp.adoc index a5c6b6f4081..98aceff1f20 100644 --- a/starters/adoc/modules/starters/pages/simpleapp.adoc +++ b/starters/adoc/modules/starters/pages/simpleapp.adoc @@ -499,8 +499,7 @@ The `jpa` branch also has the `SimpleObjectRepository` Spring Data service. * all entities. + -These are entities that are annotated with both xref:refguide:applib:index/annotation/DomainObject.adoc[@DomainObject] annotation and with the ORM-specific annotation. -For `jdo` branch, this is `@javax.jdo.annotations.PersistenceCapable`; for the `jpa` branch this is `@javax.persistence.Entity`). +These are entities that are annotated with both xref:refguide:applib:index/annotation/DomainObject.adoc[@DomainObject] annotation and with the JPA `@jakarta.persistence.Entity` annotation. + In the simpleapp starter app, the only entity is `SimpleObject`. diff --git a/testing/fakedata/fixtures/src/main/java/org/apache/causeway/testing/fakedata/fixtures/demoapp/demomodule/dom/FakeDataDemoObjectWithAll.java b/testing/fakedata/fixtures/src/main/java/org/apache/causeway/testing/fakedata/fixtures/demoapp/demomodule/dom/FakeDataDemoObjectWithAll.java index 8931566a2f5..ed140e83204 100644 --- a/testing/fakedata/fixtures/src/main/java/org/apache/causeway/testing/fakedata/fixtures/demoapp/demomodule/dom/FakeDataDemoObjectWithAll.java +++ b/testing/fakedata/fixtures/src/main/java/org/apache/causeway/testing/fakedata/fixtures/demoapp/demomodule/dom/FakeDataDemoObjectWithAll.java @@ -61,13 +61,8 @@ @Entity @Table( - //FIXME identityType=IdentityType.DATASTORE, schema = "libFakeDataFixture" ) -//FIXME -//@javax.jdo.annotations.Version( -// strategy=VersionStrategy.VERSION_NUMBER, -// column="version") @DomainObject(editing = Editing.DISABLED) @DomainObjectLayout(bookmarking = BookmarkPolicy.AS_ROOT) @NoArgsConstructor @@ -150,28 +145,15 @@ public FakeDataDemoObjectWithAll(final String name) { @Column(nullable = true) private String someString; - //FIXME @javax.jdo.annotations.Persistent() @Column(nullable = true) @Getter @Setter @Property(optionality=Optionality.OPTIONAL) private Password somePassword; - //FIXME -// @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = { -// @javax.jdo.annotations.Column(name = "someBlob_name"), -// @javax.jdo.annotations.Column(name = "someBlob_mimetype"), -// @javax.jdo.annotations.Column(name = "someBlob_bytes", jdbcType = "BLOB", sqlType = "LONGVARBINARY") -// }) @Getter @Setter @Property(optionality = Optionality.OPTIONAL) private Blob someBlob; -//FIXME -// @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = { -// @javax.jdo.annotations.Column(name = "someClob_name"), -// @javax.jdo.annotations.Column(name = "someClob_mimetype"), -// @javax.jdo.annotations.Column(name = "someClob_chars", jdbcType = "CLOB", sqlType = "LONGVARCHAR") -// }) @Getter @Setter @Property(optionality=Optionality.OPTIONAL) private Clob someClob; @@ -185,12 +167,10 @@ public FakeDataDemoObjectWithAll(final String name) { private java.sql.Date someJavaSqlDate; @Column(nullable = true) - //FIXME @javax.jdo.annotations.Persistent(defaultFetchGroup="true") @Getter @Setter private LocalDate someLocalDate; @Column(nullable = true) - //FIXME @javax.jdo.annotations.Persistent(defaultFetchGroup="true") @Getter @Setter private ZonedDateTime someZonedDateTime; @@ -214,14 +194,6 @@ public FakeDataDemoObjectWithAll(final String name) { @Getter @Setter private java.util.UUID someUuid; -// @javax.jdo.annotations.Persistent(defaultFetchGroup="true", columns = { -// @javax.jdo.annotations.Column(name = "someMoneyOptional_amount"), -// @javax.jdo.annotations.Column(name = "someMoneyOptional_currency") -// }) -// @Property(optionality = Optionality.OPTIONAL) -// @Getter @Setter -// private Money someMoney; - @Column(nullable = true) @Getter @Setter private EnumOf3 someEnumOf3; @@ -518,7 +490,6 @@ public FakeDataDemoObjectWithAll resetSomeLocalDate() { return this; } - //FIXME @javax.jdo.annotations.Persistent(defaultFetchGroup="true") @Column(nullable = true) @Getter @Setter private LocalDateTime someLocalDateTime; diff --git a/viewers/restfulobjects/adoc/modules/ROOT/pages/hints-and-tips.adoc b/viewers/restfulobjects/adoc/modules/ROOT/pages/hints-and-tips.adoc index 18f5f1b233c..2940db5fc20 100644 --- a/viewers/restfulobjects/adoc/modules/ROOT/pages/hints-and-tips.adoc +++ b/viewers/restfulobjects/adoc/modules/ROOT/pages/hints-and-tips.adoc @@ -14,7 +14,6 @@ This section provides a few hints-and-tips to help you on your way. include::hints-and-tips/pretty-printing.adoc[leveloffset=+1] include::hints-and-tips/restful-image-property.adoc[leveloffset=+1] include::hints-and-tips/view-model-as-parameter.adoc[leveloffset=+1] -include::hints-and-tips/troubleshooting.adoc[leveloffset=+1] //https://lists.apache.org/thread.html/cbd18320bbf6e5c5e767283f9e675cf56e7f4692c109e1e79dbaa90a@%3Cusers.causeway.apache.org%3E // FIXME: to add diff --git a/viewers/restfulobjects/adoc/modules/ROOT/pages/hints-and-tips/troubleshooting.adoc b/viewers/restfulobjects/adoc/modules/ROOT/pages/hints-and-tips/troubleshooting.adoc deleted file mode 100644 index a13e4907e2f..00000000000 --- a/viewers/restfulobjects/adoc/modules/ROOT/pages/hints-and-tips/troubleshooting.adoc +++ /dev/null @@ -1,88 +0,0 @@ -[[troubleshooting]] -= Troubleshooting - -: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 [...] - -== Exception - -When invoking a REST service and getting a response with an embeded stacktrace like: - -[source,json] ----- -{ - "httpStatusCode": 500, - "message": "com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions -Klasse enthält zwei Eigenschaften mit demselben Namen \"name\" - this problem is related to the following location: - at public java.lang.String ife.dep.ServiceName.getName() - at ife.dep.ServiceName - at public ife.dep.ServiceName ife.dep.ProvidedService.getServiceName() - at ife.dep.ProvidedService - at public java.util.SortedSet ife.dep.Release.getCapabilities() - at ife.dep.Release - at public ife.dep.Release ife.cfg.Configuration.getRelease() - at ife.cfg.Configuration - at public ife.cfg.Configuration ife.cfg.ConfigEntry.getConfiguration() - at ife.cfg.ConfigEntry - at public java.util.SortedSet ife.cfg.Endpoint.getCfgEntries() - at ife.cfg.Endpoint - this problem is related to the following location: - at public java.lang.String ife.dep.ServiceName.name - at ife.dep.ServiceName - at public ife.dep.ServiceName ife.dep.ProvidedService.getServiceName() - at ife.dep.ProvidedService - at public java.util.SortedSet ife.dep.Release.getCapabilities() - at ife.dep.Release - at public ife.dep.Release ife.cfg.Configuration.getRelease() - at ife.cfg.Configuration - at public ife.cfg.Configuration ife.cfg.ConfigEntry.getConfiguration() - at ife.cfg.ConfigEntry - at public java.util.SortedSet ife.cfg.Endpoint.getCfgEntries() - at ife.cfg.Endpoint -", -[...] -} ----- - -== Solution -Add `@XmlAccessorType(XmlAccessType.FIELD)` to your domain entity: - -[source,java] ----- [email protected](identityType = IdentityType.DATASTORE) [email protected](strategy = javax.jdo.annotations.IdGeneratorStrategy.NATIVE, column = "id") [email protected](strategy = VersionStrategy.VERSION_NUMBER, column = "version") -@Named("xxx.ServiceName") -@DomainObject(bounded = true) -@DomainObjectLayout(cssClassFa = "tag", describedAs = "") -@XmlAccessorType(XmlAccessType.FIELD) -@SuppressWarnings("javadoc") -public class ServiceName implements Capability, Comparable<ServiceName> { - - public String title() { - return getName(); - } - - public int compareTo(ServiceName o) { - return name.compareTo(o.name); - } - - @Override - public String toString() { - return title(); - } - - @javax.jdo.annotations.Column(allowsNull = "false") - @Getter @Setter - public String name; - - public boolean isSynchronous() { - return !isAsynchonous(); - } - - public boolean isAsynchonous() { - return name.startsWith(Constants.ESB_JMS_PREFIX); - } -} ----- -
