Skip to content

Commit

Permalink
Merge branch 'master' into agrestio#585
Browse files Browse the repository at this point in the history
# Conflicts:
#	agrest-cayenne/src/main/java/io/agrest/cayenne/path/EntityPathCache.java
#	agrest-cayenne/src/test/java/io/agrest/cayenne/path/EntityPathCacheTest.java
  • Loading branch information
m-dzianishchyts committed Feb 4, 2024
2 parents 46d9aca + 426e9c9 commit 981600d
Show file tree
Hide file tree
Showing 641 changed files with 29,697 additions and 7,126 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/verify_on_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'verify PR'

on: pull_request

jobs:
verify:
runs-on: ubuntu-latest
if: github.repository == 'agrestio/agrest'

name: JDK ${{ matrix.java }}

strategy:
matrix:
java: [ "11", "17", "21" ]
fail-fast: true

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'

- name: Build and test...
run: mvn clean verify
90 changes: 89 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,94 @@
## Release 5.0-M20

* #651 Exp: numeric scalars to support "_"
* #655 Exp syntax: deprecate case-insensitivity of NULL and booleans
* #658 DeleteBuilder: byIds(..), byMultiIds(..)
* #659 Idempotent DELETE by ids, optimizing performance
* #660 Builders: auto-detect multi-column IDs
* #662 Update expression parser with JavaCC 7.0.13

## Release 5.0.M19

* #648 NPE in CayenneExpParser for a combination of null and positional parameter
* #649 AgExpression internal cleanup

## Release 5.0.M18

* #602 Expressions - immutable parameter binding
* #603 Expressions: compact and/or chains
* #638 EntityUpdate.getToMany(String) should return null if the key is not a part of update
* #640 DataResponse<T> to support "304 Not Modified"
* #641 Cayenne IPathResolver may get "poisoned" by per-request overlayed AgEntities
* #642 TokenMgrException is not handled by Agrest
* #643 Static factory methods in Exp for conditions
* #646 org.apache.cayenne.exp.ExpressionException: [v.4.2 May 16 2023 08:31:12] In: invalid parent - Equal

## Release 5.0.M17

* #630 POST/PUT breaks for Short and BigInteger types
* #631 POST/PUT - can't update multi-key relationships
* #632 POST/PUT gets confused when relationship is passed as object
* #633 Optimize and clean up update parser
* #634 Recursive EntityUpdate parser
* #635 Write constraint only applied to "id" in the path, but not in the body
* #636 Clean up the API of EntityUpdate

## Release 5.0.M16

* #601 Exp.keyValue() only works with a narrow range of value types
* #621 Problem with timestamp formatting
* #622 Upgrade Jackson to 2.14.2
* #624 Optimization: "relatedViaQueryWithParentIds" strategy when limit is involved
* #629 Upgrade to Cayenne 4.2 GA

## Release 5.0.M15

* #614 Improve support for Java records as Agrest entities
* #618 Expand the definition of "getter" and "setter"
* #619 Swagger: do not expose UriInfo unless annotated with @Parameter

## Release 5.0.M14

* #613 Exception on include when entity id is unreadable
* #615 Swagger: ignore UriInfo if @Parameter(hidden=true) is set
* #616 Swagger: duplicate param properties
* #617 Proper handling of ObjectId annotated with @AgId

## Release 5.0.M13

* #607 OpenAPI docs for EntityUpdate should include relationships
* #610 OpenAPI descriptors should be able to resolve multi-column AgId
* #611 OpenAPI: properties must be sorted in same order as responses
* #612 OpenAPI descriptors - exclude inaccessible properties

## Release 5.0.M12

* #606 Jackson upgrade, dependency management
* #608 "Path exceeds the max allowed depth" exception for attribute sort and 0 depth
* #609 EntityUpdate-style endpoints behave differently from String and List<EntityUpdate>

## Release 5.0.M11

* #604 Allow to exclude null properties in responses
* #605 Hide deprecated protocol keys from OpenAPI descriptors

## Release 5.0.M10

* #582 AgRest own full-featured expression parser
* #594 Support for escape char in "like" expressions
* #597 Upgrade Cayenne to 4.2.RC2
* #598 Max path depth for "Include"
* #600 Max path depth for "mapBy", "sort"

## Release 5.0.M9

* #590 Can't use inherited relationships in includes

## Release 5.0.M8
*

* #583 Upgrade jackson-databind to 2.13.4.2
* #584 GET - Inheritance support - Cayenne backend
* #587 Inheritance-aware AgEntityOverlay

## Release 5.0.M7

Expand Down
36 changes: 36 additions & 0 deletions UPGRADE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
_This document contains upgrade notes for Agrest 5.x and newer. Older versions are documented in
[UPGRADE-NOTES-1-4](./UPGRADE-NOTES-1-to-4.md)._

## Upgrading to 5.0.M17

### No more single-value syntax for updating to-many relationships [#633](https://github.com/agrestio/agrest/issues/633)
A number of changes were implemented to improve consistency and functionality of the update pipeline. As a result
single value syntax for updating to-many relationships is no longer supported as it is semantically invalid. E.g. the
following won't work anymore: `{"toMany":1}` -> `{"toMany":[1]}`, and the value should be replaced with an array.

### New EntityUpdate API, no direct update's Maps modification [#636](https://github.com/agrestio/agrest/issues/636)
EntityUpdate object API was almost completely redone to better track different update components. If you used that API
directly, you will need to update your code. An important part of the change is that property maps are no longer
directly editable. Instead, you should be using the new mutator methods. So instead of `update.getAttributes().put("a", 1)`
your would need to call `update.setAttribute("a", 1)`, etc.

## Upgrading to 5.0.M16

### Got rid of custom date/time formatters [#621](https://github.com/agrestio/agrest/issues/621)

To fix formatting issues of the older dates (19th century and earlier), date/time parsing and encoding code was
refactored. Instead of a set of custom DateTimeFormatters, we are using the standard ISO formatters from the JDK.
This introduced slight behavior changes (most are actually desirable in any sane codebase) :

* No more arbitrary truncation of time precision. E.g. a time with 1ns would render as `00:00:00.000000001`, where it would
previously render as `00:00:00`
* If a property is modeled as the old `java.sql.Time`, we will no longer allow to parse times starting with "T". So
`T00:00:00` will no longer work, while `00:00:00` will. This does not affect parsing of `java.time.LocalTime`, as it
already disallowed the leading "T".

## Upgrading to 5.0.M15

### To include UriInfo in OpenAPI, an explicit annotation is required [#619](https://github.com/agrestio/agrest/issues/619)
This only affects projects that auto-generate OpenAPI documentation descriptors from Agrest endpoints.
Previously, the framework would automatically add every single Ag Protocol parameter to the endpoint signature
if an endpoint method had `@Context UriInfo` as one of the parameters. This proved to be rather inflexible
in many situations. So now by default `UriInfo` will be ignored for documentation purposes, and the way to
turn on the old behavior is to annotate it explicitly like this: `@Parameter UriInfo` (with or without `@Context`).

## Upgrading to 5.0.M1

5.0 is a major release with a number of breaking changes. Still the upgrade should be fairly straightforward in most
Expand Down
3 changes: 2 additions & 1 deletion agrest-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<parent>
<groupId>io.agrest</groupId>
<artifactId>agrest-parent</artifactId>
<version>5.0.M8-SNAPSHOT</version>
<version>5.0-SNAPSHOT</version>
</parent>

<artifactId>agrest-annotations</artifactId>
<version>5.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>agrest-annotations: model annotations</name>
<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Annotates a getter of a property in a Java object to indicate that the property is an attribute exposed via Agrest.
* Annotates a getter of a property in a POJO or a record component to indicate that the property is an "attribute"
* in the Agrest schema, and set it default access rules.
*
* @since 1.15
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Annotates a getter of a property in an object to indicate that it is the entity "id". Multiple methods can be
* annotated with "@AgId" in a given entity if a unique identifier of the object id is made of multiple properties.
* Annotates a getter of a property in a POJO or a record component to indicate that the property is a part of an entity
* "id" in the Agrest schema, and set it default access rules. Multiple properties can be annotated with "@AgId" in a
* given entity if a unique identifier of the object id is made of multiple properties.
*
* @since 1.15
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Annotates a getter of a property in a POJO to indicate that the property is a
* Agrest-exposed relationship. The property type should be either another
* entity, or a collection of entities.
* Annotates a getter of a property in a POJO or a record component to indicate that the property is a "relationship"
* in the Agrest schema, and set it default access rules. The property type should be either another entity, or a
* collection of entities.
*
* @since 1.15
*/
Expand Down
2 changes: 1 addition & 1 deletion agrest-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(e.g. "bootique-bom"). As a result have to duplicate certain distribution-related sections.
-->
<groupId>io.agrest</groupId>
<version>5.0.M8-SNAPSHOT</version>
<version>5.0-SNAPSHOT</version>
<artifactId>agrest-bom</artifactId>
<packaging>pom</packaging>
<name>agrest-bom: Bill of Materials w/all public modules</name>
Expand Down
11 changes: 6 additions & 5 deletions agrest-cayenne/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<parent>
<groupId>io.agrest</groupId>
<artifactId>agrest-parent</artifactId>
<version>5.0.M8-SNAPSHOT</version>
<version>5.0-SNAPSHOT</version>
</parent>

<artifactId>agrest-cayenne</artifactId>
<version>5.0-SNAPSHOT</version>
<name>agrest-cayenne: Cayenne backend for Agrest</name>
<description>Cayenne backend for Agrest</description>

Expand Down Expand Up @@ -44,13 +45,13 @@
</dependency>
<dependency>
<groupId>io.agrest</groupId>
<artifactId>agrest-jaxrs2</artifactId>
<artifactId>agrest-jaxrs3</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.agrest</groupId>
<artifactId>agrest-jaxrs2</artifactId>
<artifactId>agrest-jaxrs3</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
Expand All @@ -67,12 +68,12 @@
</dependency>
<dependency>
<groupId>io.bootique.jetty</groupId>
<artifactId>bootique-jetty-junit5</artifactId>
<artifactId>bootique-jetty-jakarta-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.bootique.jersey</groupId>
<artifactId>bootique-jersey</artifactId>
<artifactId>bootique-jersey-jakarta</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import io.agrest.runtime.processor.delete.stage.DeleteStartStage;
import io.agrest.runtime.processor.select.stage.SelectApplyServerParamsStage;
import io.agrest.runtime.processor.unrelate.stage.UnrelateStartStage;
import io.agrest.runtime.processor.unrelate.stage.UnrelateUpdateDateStoreStage;
import io.agrest.runtime.processor.unrelate.stage.UnrelateUpdateDataStoreStage;
import io.agrest.runtime.processor.update.UpdateFlavorDIKeys;
import io.agrest.runtime.processor.update.stage.UpdateApplyServerParamsStage;
import io.agrest.runtime.processor.update.stage.UpdateCommitStage;
Expand Down Expand Up @@ -144,7 +144,7 @@ public void configure(Binder binder) {

// Cayenne overrides for unrelate stages
binder.bind(UnrelateStartStage.class).to(CayenneUnrelateStartStage.class);
binder.bind(UnrelateUpdateDateStoreStage.class).to(CayenneUnrelateDataStoreStage.class);
binder.bind(UnrelateUpdateDataStoreStage.class).to(CayenneUnrelateDataStoreStage.class);
}

public static class Builder {
Expand Down
Loading

0 comments on commit 981600d

Please sign in to comment.