cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: 4.1 new features overview
Date Sat, 22 Dec 2018 08:17:14 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 05e42311b -> 38e556586


4.1 new features overview


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/38e55658
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/38e55658
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/38e55658

Branch: refs/heads/master
Commit: 38e55658644851d903076a93bbfc681fd8597dd4
Parents: 05e4231
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Sat Dec 22 11:17:03 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Sat Dec 22 11:17:03 2018 +0300

----------------------------------------------------------------------
 .../asciidoc/_upgrade-guide/new-features.adoc   |  73 ++++++++++++++++++-
 .../docs/asciidoc/images/modeler-dbimport.png   | Bin 0 -> 169600 bytes
 2 files changed, 71 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/38e55658/docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/new-features.adoc
----------------------------------------------------------------------
diff --git a/docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/new-features.adoc
b/docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/new-features.adoc
index bcc3372..c7a2c5f 100644
--- a/docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/new-features.adoc
+++ b/docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/new-features.adoc
@@ -13,8 +13,77 @@
 // License.
 == Java Version
 
-Minimum required JDK version is 1.8 or newer. Cayenne 4.1 is fully tested with Java 1.8 and
9.
+Minimum required JDK version is 1.8 or newer.
+Cayenne 4.1 is fully tested with Java 1.8 and 11.
 
 == New Features
 
-// TODO: new features
\ No newline at end of file
+=== Cayenne Core is Dependency-Free
+
+Cayenne now depends only on `slf4j-api` library. We removed `velocity`, `commons-lang` and
`commons-collections` dependencies from the Cayenne core. Velocity templates replaced with
a simplified (and also much faster) parser for the parts of the Velocity syntax essential
for Cayenne.
+
+This should be transparent in almost all case. See `UPGRADE.txt` for details.
+
+=== Field-Based Data Objects
+
+Cayenne *4.1* generates field-based DataObjects by default. And it is HUGE for the app performance.
The new objects are much faster to read and write and significantly reduce the overall app
memory footprint and the corresponding GC pauses.
+
+The new objects are mostly backwards-compatible with our “classic” map-based objects
from the application standpoint. The main source of incompatibility is support for “dynamic”
properties (i.e. persistent properties not known at compile time).
+
+Field-based DataObjects are generated via new class templates. So to take advantage of this
feature you should simply regenerate you model classes.
+
+=== Extensible Project XML Structure
+
+Cayenne mapping project structure was modularized, allowing embedding of extensions with
their own XML schemas.
+This enables support for comments for entities, attributes and relationships.
+Also Cayenne 4.1 have extensions for cdbimport and cgen, making OR modeling workflow experience
so much smoother.
+
+image::../images/modeler-dbimport.png[align="center"]
+
+== API Changes
+
+=== Transaction propagation logic and isolation level
+
+New API allows to fully control transaction behavior where it's needed.
+
+[source,java]
+----
+TransactionManager manager = runtime.getInjector().getInstance(TransactionManager.class);
+    TransactionDescriptor descriptor = new TransactionDescriptor(
+            Connection.TRANSACTION_SERIALIZABLE, // set transaction isolation to SERIALIZABLE
+            TransactionPropagation.REQUIRES_NEW  // require new transaction for every operation
+    );
+    manager.performInTransaction(() -> {
+        // perform some DB operations...
+        return null;
+    }, descriptor);
+----
+
+=== Injectable PkGenerator
+
+All `PkGenerators` are now managed by DI so you can simply inject your own implementation.
+
+[source,java]
+----
+ServerModule.contributePkGenerators(binder)
+                .put(MySQLAdapter.class.getName(), CustomSQLPkGenerator.class);
+----
+
+=== DataChannelFilter replaced with DataChannelQueryFilter and DataChannelSyncFilter
+
+`DataChannelFilter` is deprecated. Instead two separate filters are introduced.
+
+[source,java]
+----
+ServerModule.contributeDomainQueryFilters(binder).add((context, query, chain) -> {
+    // do something with query
+    // ...
+    return chain.onQuery(context, query);
+});
+
+ServerModule.contributeDomainSyncFilters(binder).add((context, changes, syncType, chain)
-> {
+    // do something with changes
+    // ...
+    return chain.onSync(context, changes, syncType);
+});
+----
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/38e55658/docs/asciidoc/upgrade-guide/src/docs/asciidoc/images/modeler-dbimport.png
----------------------------------------------------------------------
diff --git a/docs/asciidoc/upgrade-guide/src/docs/asciidoc/images/modeler-dbimport.png b/docs/asciidoc/upgrade-guide/src/docs/asciidoc/images/modeler-dbimport.png
new file mode 100644
index 0000000..0064248
Binary files /dev/null and b/docs/asciidoc/upgrade-guide/src/docs/asciidoc/images/modeler-dbimport.png
differ


Mime
View raw message