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 2021/06/13 15:17:55 UTC
[isis-app-helloworld] branch jdo-SNAPSHOT updated (77a7a8b ->
83df661)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch jdo-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/isis-app-helloworld.git.
from 77a7a8b Merge branch 'jpa-SNAPSHOT' into jdo-SNAPSHOT
add 41353c6 configures h2 to support lowercase
new 83df661 Merge branch 'jpa-SNAPSHOT' into jdo-SNAPSHOT
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../modules/hello/dom/hwo/HelloWorldObject.java | 25 ++++++++++++----------
.../java/domainapp/modules/hello/types/Notes.java | 5 +++--
src/main/resources/application.yml | 4 ----
src/main/resources/config/application.properties | 13 +++++++----
4 files changed, 26 insertions(+), 21 deletions(-)
[isis-app-helloworld] 01/01: Merge branch 'jpa-SNAPSHOT' into
jdo-SNAPSHOT
Posted by da...@apache.org.
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 83df661aa7d4e727396361c84ea12771023b254c
Merge: 77a7a8b 41353c6
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Jun 13 16:11:05 2021 +0100
Merge branch 'jpa-SNAPSHOT' into jdo-SNAPSHOT
# Conflicts:
# src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObject.java
# src/main/resources/application.yml
# src/main/resources/config/application.properties
.../modules/hello/dom/hwo/HelloWorldObject.java | 25 ++++++++++++----------
.../java/domainapp/modules/hello/types/Notes.java | 5 +++--
src/main/resources/application.yml | 4 ----
src/main/resources/config/application.properties | 13 +++++++----
4 files changed, 26 insertions(+), 21 deletions(-)
diff --cc src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObject.java
index 0f628a9,8a5ad9a..62817ad
--- a/src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObject.java
+++ b/src/main/java/domainapp/modules/hello/dom/hwo/HelloWorldObject.java
@@@ -22,35 -20,40 +22,38 @@@ import org.apache.isis.applib.services.
import domainapp.modules.hello.types.Name;
import domainapp.modules.hello.types.Notes;
- @javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "hello" )
-@javax.persistence.Entity
-@javax.persistence.Table(
- schema="hello",
- name = "HelloWorldObject",
- uniqueConstraints = {
- @javax.persistence.UniqueConstraint(name = "HelloWorldObject__name__UNQ", columnNames = {"name"})
- }
++@javax.jdo.annotations.PersistenceCapable(
++ schema = "hello",
++ identityType = IdentityType.DATASTORE
++)
++@javax.jdo.annotations.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(
+ name = "findByName",
+ value = "SELECT " +
+ "FROM domainapp.modules.hello.dom.hwo.HelloWorldObject " +
+ "WHERE name.indexOf(:name) >= 0"
+ )
)
- @javax.jdo.annotations.Version(strategy= VersionStrategy.DATE_TIME, column ="version")
- @javax.jdo.annotations.Unique(name="HelloWorldObject_name_UNQ", members = {"name"})
- @DomainObject(entityChangePublishing = Publishing.ENABLED)
-@javax.persistence.EntityListeners(JpaEntityInjectionPointResolver.class) // injection support
+ @DomainObject(logicalTypeName = "hello.HelloWorldObject", entityChangePublishing = Publishing.ENABLED)
@DomainObjectLayout() // causes UI events to be triggered
public class HelloWorldObject implements Comparable<HelloWorldObject> {
- public HelloWorldObject(){}
- protected HelloWorldObject(){}
-
- @javax.persistence.Id
- @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
- @javax.persistence.Column(nullable = false, name = "id")
- private Long id;
-
- @javax.persistence.Version
- @javax.persistence.Column(nullable = false, name = "version")
- private int version;
-
++ private HelloWorldObject(){}
public HelloWorldObject(final String name) {
this.name = name;
}
- public String title() {
- return "Object: " + getName();
- }
- @javax.persistence.Column(length = Name.MAX_LEN, nullable = false, name = "name")
+
private String name;
+ @Title(prepend = "Object: ")
@Name
@PropertyLayout(fieldSetId = "identity", sequence = "1")
public String getName() {
diff --cc src/main/java/domainapp/modules/hello/types/Notes.java
index ef02e7f,e77bbe2..334c56e
--- a/src/main/java/domainapp/modules/hello/types/Notes.java
+++ b/src/main/java/domainapp/modules/hello/types/Notes.java
@@@ -11,12 -11,12 +11,13 @@@ import org.apache.isis.applib.annotatio
import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
+ import org.apache.isis.applib.annotation.Where;
+@javax.jdo.annotations.Column(length = Notes.MAX_LEN, allowsNull = "true")
@Property(editing = Editing.ENABLED, maxLength = Notes.MAX_LEN, optionality = Optionality.OPTIONAL)
- @PropertyLayout(multiLine = 5)
+ @PropertyLayout(multiLine = 10, hidden = Where.ALL_TABLES)
@Parameter(maxLength = Notes.MAX_LEN, optionality = Optionality.OPTIONAL)
- @ParameterLayout(multiLine = 5)
+ @ParameterLayout(multiLine = 10)
@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Notes {
diff --cc src/main/resources/application.yml
index 64bf5d3,5f6ed41..cbbe9e0
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@@ -43,25 -43,14 +43,21 @@@ isis
max-title-length-in-standalone-tables: 0
max-title-length-in-parented-tables: 0
- persistence:
- schema:
- auto-create-schemas: hello
- create-schema-sql-template: "CREATE SCHEMA IF NOT EXISTS %S"
-eclipselink:
- # if enabled, then must be run with JVM arg:
- # -javaagent:lib/spring-instrument-5.3.5.jar
- weaving: false
- # if weaving subproperties are required, then specify all eclipselink.weaving
- # properties using application.properties instead (it's not possible to
- # specify both eclipselink.weaving property and its subproperties using yaml syntax)
+# note that properties under 'datanucleus' must use camelCase rather than kebab-case
+datanucleus:
+ schema:
+ validateTables: true
+ validateConstraints: true
+
+ persistenceByReachabilityAtCommit: false
+ identifier:
+ case: MixedCase
+
+ cache:
+ level2:
+ type: none
+ mode: ENABLE_SELECTIVE
resteasy:
jaxrs:
diff --cc src/main/resources/config/application.properties
index efbbaf4,7e5b73b..33a3029
--- a/src/main/resources/config/application.properties
+++ b/src/main/resources/config/application.properties
@@@ -8,9 -8,18 +8,14 @@@
#
- # note that properties under 'datanucleus' must use camelCase rather than kebab-case
+ spring.flyway.enabled=false
- datanucleus.schema.autoCreateAll=true
+ spring.sql.init.platform=h2
+ spring.datasource.url=jdbc:h2:mem:hello;DATABASE_TO_UPPER=false
+ spring.datasource.driver-class-name=org.h2.Driver
+
+ isis.persistence.schema.create-schema-sql-template=CREATE SCHEMA IF NOT EXISTS %s
+ isis.persistence.schema.auto-create-schemas=hello
- spring.datasource.platform=h2
- spring.datasource.url=jdbc:h2:mem:helloworld
-eclipselink.deploy-on-startup=true
-eclipselink.ddl-generation.output-mode=both
-eclipselink.ddl-generation=create-tables
-eclipselink.create-ddl-jdbc-file-name=create-db-schema.sql
-eclipselink.application-location=.
-eclipselink.jpa.upper-case-column-names=false
++# note that properties under 'datanucleus' must use camelCase rather than kebab-case
++datanucleus.schema.autoCreateAll=true