Skip to content

Commit 31d08f7

Browse files
committed
UPGRADE notes cleanup:
merging upgrade-guide "book" to the .md file
1 parent 545bfb4 commit 31d08f7

7 files changed

Lines changed: 64 additions & 333 deletions

File tree

UPGRADE.md

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,22 @@ and the release you are upgrading to.
8787
extensions. If you encounter those, change how you configure the modules, following this general pattern
8888
(using `CacheInvalidationModule` as an example):
8989
```java
90-
ServerRuntime.builder(..)
90+
CayenneRuntime.builder(..)
9191
.addModule(b -> CacheInvalidationModule.extend(b).addHandler(MyHandler.class))
9292
.build();
9393
```
9494
Two things to note: (1) a module-specific extender is created using an `extend(Binder)` method of the
9595
module, and (2) an extender does not produce a `Module` — instead it adds services directly to the
9696
`Binder`. So it is usually invoked within a lambda that produces a `Module`, or within an app `Module`.
9797
98-
* Per [CAY-2822](https://issues.apache.org/jira/browse/CAY-2822) `cayenne-server` module is renamed to `cayenne` — update your build scripts accordingly.
98+
* Per [CAY-2822](https://issues.apache.org/jira/browse/CAY-2822) `cayenne-server` module is renamed to `cayenne` — update your build scripts accordingly:
99+
```xml
100+
<dependency>
101+
<groupId>org.apache.cayenne</groupId>
102+
<artifactId>cayenne</artifactId>
103+
<version>{version}</version>
104+
</dependency>
105+
```
99106
100107
* Per [CAY-2823](https://issues.apache.org/jira/browse/CAY-2823) `ServerRuntime` is deprecated. Use `org.apache.cayenne.runtime.CayenneRuntime` instead.
101108
@@ -106,7 +113,13 @@ and the release you are upgrading to.
106113
* Per [CAY-2825](https://issues.apache.org/jira/browse/CAY-2825) Package `org.apache.cayenne.configuration.server` was renamed to
107114
`org.apache.cayenne.configuration.runtime` — fix your imports accordingly.
108115
109-
* Per [CAY-2826](https://issues.apache.org/jira/browse/CAY-2826) `ServerModule` renamed to `CoreModule`.
116+
* Per [CAY-2826](https://issues.apache.org/jira/browse/CAY-2826) `ServerModule` renamed to `CoreModule`. The new builder pattern combining both changes:
117+
```java
118+
CayenneRuntime runtime = CayenneRuntime.builder()
119+
.addConfig("cayenne-project.xml")
120+
.module(b -> CoreModule.extend(b).setProperty("some_property", "some_value"))
121+
.build();
122+
```
110123
111124
* Per [CAY-2828](https://issues.apache.org/jira/browse/CAY-2828) The `server` prefix was removed from the names of runtime properties and named collections
112125
defined in `org.apache.cayenne.configuration.Constants`. Update references in code and in any scripts
@@ -115,3 +128,51 @@ and the release you are upgrading to.
115128
* Per [CAY-2845](https://issues.apache.org/jira/browse/CAY-2845) `DataObject` interface and `BaseDataObject` class were deprecated and all logic moved to
116129
the `Persistent` interface and `PersistentObject` class. Regenerate model classes via the cgen tool in
117130
CayenneModeler or Maven/Gradle plugins.
131+
132+
## New Features in 5.0
133+
134+
### New Dev Versioning Scheme
135+
136+
Snapshot versions are now a constant value — the dev version of 5.0 will always be `5.0-SNAPSHOT`,
137+
so you can stay at the bleeding edge of development if needed:
138+
139+
```xml
140+
<dependency>
141+
<groupId>org.apache.cayenne</groupId>
142+
<artifactId>cayenne</artifactId>
143+
<version>5.0-SNAPSHOT</version>
144+
</dependency>
145+
```
146+
147+
### New Class Generation UI
148+
149+
The new Class Generation UI in CayenneModeler simplifies configuration, allows multiple `cgen` setups
150+
per project, and includes a template editor. Custom templates are now part of the project XML
151+
configuration and don't require separate setup in either Modeler or Maven/Gradle plugins.
152+
153+
### Improved `(not)exists` Queries
154+
155+
`(not)exists` is now directly supported by the Expression API (including `Expression`, the expression
156+
parser, and the Property API) — no need to construct a subquery manually. The feature can handle any
157+
expression and spawn several sub-queries per expression if needed:
158+
159+
```java
160+
long count = ObjectSelect.query(Artist.class)
161+
.where(Artist.PAINTING_ARRAY.dot(Painting.PAINTING_TITLE).like("painting%").exists())
162+
.selectCount(context);
163+
```
164+
165+
### Improved SQL Support
166+
167+
`ANY` and `ALL` subqueries are now supported, as well as `case-when` expressions:
168+
169+
```java
170+
import static org.apache.cayenne.exp.ExpressionFactory.*;
171+
// ...
172+
Expression caseWhenExp = caseWhen(
173+
List.of(betweenExp("estimatedPrice", 0, 9),
174+
betweenExp("estimatedPrice", 10, 20)),
175+
List.of(wrapScalarValue("low"),
176+
wrapScalarValue("high")),
177+
wrapScalarValue("error"));
178+
```

docs/asciidoc/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<module>cayenne-guide</module>
3737
<module>getting-started-guide</module>
3838
<module>getting-started-db-first</module>
39-
<module>upgrade-guide</module>
4039
</modules>
4140

4241
<properties>

docs/asciidoc/upgrade-guide/pom.xml

Lines changed: 0 additions & 121 deletions
This file was deleted.

docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/changes.adoc

Lines changed: 0 additions & 74 deletions
This file was deleted.

docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/header.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/asciidoc/upgrade-guide/src/docs/asciidoc/_upgrade-guide/new-features.adoc

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)