You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2022/07/31 21:11:28 UTC

[isis-app-helloworld] 02/02: Merge branch 'jpa-SNAPSHOT' into jdo-SNAPSHOT

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

danhaywood pushed a commit to branch jdo-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/isis-app-helloworld.git

commit 766ae6578ff361df7e980b415ed75065b565fc71
Merge: 43d7a47 61f3b02
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Jul 31 22:10:51 2022 +0100

    Merge branch 'jpa-SNAPSHOT' into jdo-SNAPSHOT

 .../hello/dom/hwo/HelloWorldObject.columnOrder.txt |  2 ++
 .../modules/hello/dom/hwo/HelloWorldObject.java    | 32 ++++++++++++++++------
 .../hello/dom/hwo/HelloWorldObject.layout.xml      |  7 ++---
 .../modules/hello/dom/hwo/HelloWorldObjects.java   | 15 +++++-----
 4 files changed, 35 insertions(+), 21 deletions(-)

diff --cc src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObject.java
index a8e8680,1d3bd7e..249e4dd
--- a/src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObject.java
+++ b/src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObject.java
@@@ -3,9 -3,17 +3,16 @@@ package domainapp.modules.hello.dom.hwo
  import java.util.Comparator;
  
  import javax.inject.Inject;
+ import javax.inject.Named;
 -import javax.persistence.Column;
 -import javax.persistence.Entity;
 -import javax.persistence.EntityListeners;
 -import javax.persistence.GeneratedValue;
 -import javax.persistence.GenerationType;
 -import javax.persistence.Id;
 -import javax.persistence.Table;
 -import javax.persistence.Transient;
 -import javax.persistence.UniqueConstraint;
 -import javax.persistence.Version;
++import javax.jdo.annotations.DatastoreIdentity;
 +import javax.jdo.annotations.IdGeneratorStrategy;
 +import javax.jdo.annotations.IdentityType;
++import javax.jdo.annotations.PersistenceCapable;
++import javax.jdo.annotations.Queries;
++import javax.jdo.annotations.Query;
++import javax.jdo.annotations.Unique;
++import javax.jdo.annotations.Version;
 +import javax.jdo.annotations.VersionStrategy;
  
  import org.apache.isis.applib.annotation.Action;
  import org.apache.isis.applib.annotation.ActionLayout;
@@@ -22,24 -32,17 +30,25 @@@ import org.apache.isis.applib.services.
  import domainapp.modules.hello.types.Name;
  import domainapp.modules.hello.types.Notes;
  
- @javax.jdo.annotations.PersistenceCapable(
 -@Entity
 -@Table(
 -        schema="hello",
 -        name = "HelloWorldObject",
 -        uniqueConstraints = {
 -                @UniqueConstraint(name = "HelloWorldObject__name__UNQ", columnNames = {"name"})
 -        }
++@PersistenceCapable(
 +        schema = "hello",
 +        identityType = IdentityType.DATASTORE
 +)
- @javax.jdo.annotations.Unique(
++@Unique(
 +        name = "HelloWorldObject__name__UNQ", members = {"name"}
 +)
- @javax.jdo.annotations.DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
- @javax.jdo.annotations.Version(strategy= VersionStrategy.VERSION_NUMBER, column ="version")
- @javax.jdo.annotations.Queries(
-         @javax.jdo.annotations.Query(
++@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
++@Version(strategy= VersionStrategy.VERSION_NUMBER, column ="version")
++@Queries(
++        @Query(
 +                name = "findByName",
 +                value = "SELECT " +
 +                        "FROM domainapp.modules.hello.dom.hwo.HelloWorldObject " +
 +                        "WHERE name.indexOf(:name) >= 0"
 +        )
  )
- @DomainObject(logicalTypeName = "hello.HelloWorldObject", entityChangePublishing = Publishing.ENABLED)
 -@EntityListeners(IsisEntityListener.class) // injection support
+ @Named("hello.HelloWorldObject")
+ @DomainObject()
  @DomainObjectLayout()  // causes UI events to be triggered
  public class HelloWorldObject implements Comparable<HelloWorldObject> {
  
diff --cc src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObjects.java
index 3c20ade,2bb54dc..44e1c93
--- a/src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObjects.java
+++ b/src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObjects.java
@@@ -12,24 -14,24 +14,23 @@@ import org.apache.isis.applib.annotatio
  import org.apache.isis.applib.annotation.PromptStyle;
  import org.apache.isis.applib.annotation.RestrictTo;
  import org.apache.isis.applib.annotation.SemanticsOf;
 +import org.apache.isis.applib.query.Query;
  import org.apache.isis.applib.services.repository.RepositoryService;
- import org.apache.isis.persistence.jdo.applib.services.JdoSupportService;
+ 
 +
  import domainapp.modules.hello.types.Name;
  
- @DomainService(
-         nature = NatureOfService.VIEW,
-         logicalTypeName = "hello.HelloWorldObjects"
- )
- @javax.annotation.Priority(PriorityPrecedence.EARLY)
+ @Named("hello.HelloWorldObjects")
+ @DomainService(nature = NatureOfService.VIEW)
+ @Priority(PriorityPrecedence.EARLY)
  public class HelloWorldObjects {
  
      private final RepositoryService repositoryService;
 -    private final HelloWorldRepository helloWorldRepository;
  
+     @Inject
      public HelloWorldObjects(
 -            final RepositoryService repositoryService,
 -            final HelloWorldRepository helloWorldRepository) {
 +            final RepositoryService repositoryService) {
          this.repositoryService = repositoryService;
 -        this.helloWorldRepository = helloWorldRepository;
      }
  
      @Action(semantics = SemanticsOf.NON_IDEMPOTENT)