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/08/02 09:11:01 UTC
[isis-app-simpleapp] branch jpa-SNAPSHOT updated: removes unnecessary imports
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch jpa-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git
The following commit(s) were added to refs/heads/jpa-SNAPSHOT by this push:
new 55a7df4 removes unnecessary imports
55a7df4 is described below
commit 55a7df49697e141037f40e67e8401fdaf641ab80
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Aug 2 10:08:36 2022 +0100
removes unnecessary imports
---
.../modules/simple/dom/so/SimpleObject.java | 44 ++++++++++++++--------
.../modules/simple/dom/so/SimpleObjects.java | 7 +++-
2 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
index f9614f4..7c61b9e 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
@@ -4,6 +4,18 @@ 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.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.persistence.UniqueConstraint;
+import javax.persistence.Version;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.isis.applib.annotation.Action;
@@ -37,22 +49,22 @@ import domainapp.modules.simple.types.Name;
import domainapp.modules.simple.types.Notes;
-@javax.persistence.Entity
-@javax.persistence.Table(
+@Entity
+@Table(
schema= SimpleModule.SCHEMA,
uniqueConstraints = {
- @javax.persistence.UniqueConstraint(name = "SimpleObject__name__UNQ", columnNames = {"NAME"})
+ @UniqueConstraint(name = "SimpleObject__name__UNQ", columnNames = {"NAME"})
}
)
-@javax.persistence.NamedQueries({
- @javax.persistence.NamedQuery(
+@NamedQueries({
+ @NamedQuery(
name = SimpleObject.NAMED_QUERY__FIND_BY_NAME_LIKE,
query = "SELECT so " +
"FROM SimpleObject so " +
"WHERE so.name LIKE :name"
)
})
-@javax.persistence.EntityListeners(IsisEntityListener.class)
+@EntityListeners(IsisEntityListener.class)
@Named(SimpleModule.NAMESPACE +
".SimpleObject")
@DomainObject(entityChangePublishing = Publishing.ENABLED)
@@ -64,13 +76,13 @@ public class SimpleObject implements Comparable<SimpleObject> {
static final String NAMED_QUERY__FIND_BY_NAME_LIKE = "SimpleObject.findByNameLike";
- @javax.persistence.Id
- @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
- @javax.persistence.Column(name = "id", nullable = false)
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ @Column(name = "id", nullable = false)
private Long id;
- @javax.persistence.Version
- @javax.persistence.Column(name = "version", nullable = false)
+ @Version
+ @Column(name = "version", nullable = false)
@PropertyLayout(fieldSetId = "metadata", sequence = "999")
@Getter @Setter
private long version;
@@ -81,21 +93,21 @@ public class SimpleObject implements Comparable<SimpleObject> {
return simpleObject;
}
- @Inject @javax.persistence.Transient RepositoryService repositoryService;
- @Inject @javax.persistence.Transient TitleService titleService;
- @Inject @javax.persistence.Transient MessageService messageService;
+ @Inject @Transient RepositoryService repositoryService;
+ @Inject @Transient TitleService titleService;
+ @Inject @Transient MessageService messageService;
@Title
@Name
- @javax.persistence.Column(length = Name.MAX_LEN, nullable = false)
+ @Column(length = Name.MAX_LEN, nullable = false)
@Getter @Setter @ToString.Include
@PropertyLayout(fieldSetId = LayoutConstants.FieldSetId.IDENTITY, sequence = "1")
private String name;
@Notes
- @javax.persistence.Column(length = Notes.MAX_LEN, nullable = true)
+ @Column(length = Notes.MAX_LEN, nullable = true)
@Getter @Setter
@Property(commandPublishing = Publishing.ENABLED, executionPublishing = Publishing.ENABLED)
@PropertyLayout(fieldSetId = LayoutConstants.FieldSetId.DETAILS, sequence = "2")
diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObjects.java b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObjects.java
index a124ef0..c0416e4 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObjects.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObjects.java
@@ -2,6 +2,7 @@ package domainapp.modules.simple.dom.so;
import java.util.List;
+import javax.annotation.Priority;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.EntityManager;
@@ -21,13 +22,15 @@ import org.apache.isis.applib.services.repository.RepositoryService;
import org.apache.isis.commons.functional.Try;
import org.apache.isis.persistence.jpa.applib.services.JpaSupportService;
+import lombok.RequiredArgsConstructor;
+
import domainapp.modules.simple.SimpleModule;
import domainapp.modules.simple.types.Name;
@Named(SimpleModule.NAMESPACE + ".SimpleObjects")
@DomainService(nature = NatureOfService.VIEW)
-@javax.annotation.Priority(PriorityPrecedence.EARLY)
-@lombok.RequiredArgsConstructor(onConstructor_ = {@Inject} )
+@Priority(PriorityPrecedence.EARLY)
+@RequiredArgsConstructor(onConstructor_ = {@Inject} )
public class SimpleObjects {
final RepositoryService repositoryService;