Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/version 2.2.0 #386

Merged
merged 203 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
6200a5f
Feature/transient fields (#142)
wog48 Apr 14, 2020
2df7e8f
Add sonar plugin (#144)
wog48 Apr 15, 2020
dde6362
Feature/logging (#145)
wog48 Apr 18, 2020
78a8645
Feature/logging (#147)
wog48 May 3, 2020
7ab98ab
Feature/logging (#148)
wog48 May 4, 2020
8f32d18
Feature/logging (#150)
wog48 May 4, 2020
db7bd68
Feature/logging (#151)
wog48 May 5, 2020
86c5c4d
Feature/logging (#152)
wog48 May 7, 2020
5027b1f
Update README.md (#153)
wog48 May 8, 2020
fcde6c6
Feature/logging (#154)
wog48 May 8, 2020
66c76c0
Increase test coverage for criteria builder (#155)
wog48 May 9, 2020
c124d83
Feature/criteria builder (#156)
wog48 May 9, 2020
e3b5e59
Update README.md (#157)
wog48 May 9, 2020
d901965
Feature/criteria builder (#158)
wog48 May 12, 2020
1782881
Feature/criteria builder (#159)
wog48 May 17, 2020
bd6cfb5
Update README.md (#160)
wog48 May 19, 2020
fe7c443
Remove potential null pointer (#161)
wog48 May 21, 2020
54097b6
Bugfix/sonar issues (#162)
wog48 May 21, 2020
b933d49
Bugfix/sonar issues (#163)
wog48 May 21, 2020
440946c
Bugfix/sonar issues (#164)
wog48 May 23, 2020
a0aa728
Bugfix/sonar issues (#165)
wog48 May 23, 2020
cdb6b95
Feature/release 1.0.0 (#170)
wog48 May 26, 2020
1ca3554
Bugfix/issue98 (#173)
wog48 Jun 7, 2020
3473658
Bugfix/issue98 (#174)
wog48 Jun 20, 2020
3499dcb
sonar issues (#175)
wog48 Jun 20, 2020
353e0ff
Bugfix/issue98 (#176)
wog48 Jun 20, 2020
9fef01f
Bugfix/issue98 (#177)
wog48 Jun 20, 2020
d2a4288
Feature/criteria builder (#178)
wog48 Jun 21, 2020
b140624
Add README.md and correct spelling errors (#179)
wog48 Jun 21, 2020
5e29185
Feature/release 1.0.0 (#192)
wog48 Oct 16, 2020
8e42b89
Correct criteria builder implementation (#193)
wog48 Nov 4, 2020
df194e8
Feature/criteria builder (#194)
wog48 Nov 22, 2020
706b0e0
Feature/criteria builder (#195)
wog48 Nov 22, 2020
c92bd08
Feature/criteria builder (#196)
wog48 Nov 24, 2020
918cf9d
Feature/criteria builder (#197)
wog48 Nov 25, 2020
cb443ba
Feature/criteria builder (#198)
wog48 Nov 30, 2020
955dbd4
Feature/criteria builder (#199)
wog48 Dec 30, 2020
999e3b4
missing variable usage (#200)
wog48 Jan 3, 2021
febcbd3
Clean-up Sonar issues (#201)
wog48 Jan 3, 2021
b000c00
Bugfix/no mapper for operations (#202)
wog48 Jan 3, 2021
a254566
Feature/1.0.1 (#203)
wog48 Jan 3, 2021
df47af2
New version (#204)
wog48 Jan 4, 2021
1dfa42f
Bugfix/filter eq withdate (#205)
wog48 Jan 4, 2021
6d0c7e2
Us generated alias for column selection (#206)
wog48 Jan 4, 2021
a177795
Upgrade Version (#207)
wog48 Jan 4, 2021
47d669e
Reduce complexity (#209)
wog48 Jan 5, 2021
3bc5176
ALL did not work with functions like startswith (#210)
wog48 Jan 7, 2021
231f726
Update version (#208)
wog48 Jan 10, 2021
ac93dc5
Entity Set Path @ DB Functions (#211)
wog48 Jan 10, 2021
d27c6e6
Feature/new archetype (#212)
wog48 Jan 19, 2021
5504abd
Feature/new archetype (#213)
wog48 Jan 24, 2021
4419f0d
Feature/new archetype (#214)
wog48 Feb 10, 2021
d790102
Replace Reflections API by Reflections8 (#215)
wog48 Apr 21, 2021
8c1033c
Support entitytypes singeltons (#216)
wog48 May 17, 2021
77589e8
Update README.md (#218)
wog48 Oct 1, 2021
b2e5318
Solve issue 136 (#217)
wog48 Oct 3, 2021
c7b300b
Eliminate WhiteSource detected vulnerabilities (#219)
wog48 Oct 4, 2021
8c59937
Remove setExternalName from Metadata Post Processor (#220)
wog48 Oct 4, 2021
cbd6ac4
Support entitytypes singeltons (#221)
wog48 Oct 5, 2021
8d6f44f
Support entitytypes singeltons (#222)
wog48 Oct 7, 2021
6bdf79f
Query extension declaration (#223)
wog48 Nov 5, 2021
d53f7f6
Support entity types and singletons (#224)
wog48 Nov 7, 2021
545ce73
Support cast on navigations (#225)
wog48 Nov 10, 2021
d41ca35
Update README.md (#226)
wog48 Nov 11, 2021
f4fac3f
Bugfix/no constranis with ignored properties (#227)
wog48 Nov 13, 2021
8315f15
Bugfix/no constranis with ignored properties (#228)
wog48 Nov 15, 2021
7b0c8d3
Enable subtyping for complex types (#229)
wog48 Nov 17, 2021
06da7d4
Support transient properties that require ignored properties (#231)
wog48 Nov 20, 2021
0ff3ca1
Bugfix/multi level inheritance (#232)
wog48 Nov 24, 2021
d901476
Bugfix/multi level inheritance (#233)
wog48 Nov 27, 2021
2f56e13
Feature/release 1.0.3 (#234)
wog48 Nov 28, 2021
938b7a4
Feature/release 1.0.4 (#235)
wog48 Dec 7, 2021
c779a59
Feature/release 1.0.4 (#236)
wog48 Dec 10, 2021
38eb107
Error correction (#237)
wog48 Dec 17, 2021
47ee683
Feature/release 1.0.5 (#238)
wog48 Dec 17, 2021
134eceb
Update H2 version (#239)
wog48 Jan 10, 2022
e233a65
Feature/release 1.0.6 (#240)
wog48 Jan 10, 2022
8c669a1
Upgrade version and additional tests (#241)
wog48 Jan 25, 2022
37d9f27
New version an sonar clean-up (#242)
wog48 Jan 27, 2022
3338374
Release 1.1.0 (#243)
wog48 Jan 27, 2022
02b66ba
Release 1.1.0 (#244)
wog48 Jan 27, 2022
db4bcfc
Update version -> 1.0.8 (#245)
wog48 Mar 4, 2022
84cd240
Feature/release 1.0.0 (#247)
wog48 Jun 30, 2022
670d010
Generate metadata for overloaded action (#248)
wog48 Sep 4, 2022
2112bb4
Feature/action overload (#249)
wog48 Sep 7, 2022
79b6c56
Fix claims in collections where (#250)
wog48 Sep 7, 2022
be57eee
Use dbtype to build key pair in case a conversion exists (#251)
wog48 Sep 8, 2022
2325fd7
Enable more constructors for binding parameter (#252)
wog48 Sep 13, 2022
b95824f
Feature/more flexable constructor determination operations (#253)
wog48 Sep 14, 2022
214272b
New type cast added - they have possible data lost (#254)
wog48 Sep 16, 2022
0696ebc
Collection not longer retrieves transient (#255)
wog48 Sep 19, 2022
5d0713c
Enhance partner determination (#256)
wog48 Sep 19, 2022
0142d98
Bugfix/reuse navigation as partner (#257)
wog48 Sep 19, 2022
71bac32
Bugfix/reuse navigation as partner (#258)
wog48 Sep 20, 2022
a4b7dcf
No fallback to server locale in case bundle requested local not found…
wog48 Sep 27, 2022
e5ea988
Replace file reader (#260)
wog48 Sep 27, 2022
e693797
Replace fixed values by variables (#261)
wog48 Sep 27, 2022
cfdf322
Bugfix/error in controller test (#262)
wog48 Sep 28, 2022
2988b7a
Update archetype pom (#265)
wog48 Oct 10, 2022
3a9bd80
Defect/archetype pom (#266)
wog48 Oct 10, 2022
8eb51f3
Update test constants (#267)
wog48 Oct 11, 2022
6de32b1
Correct count behavior (#268)
wog48 Nov 3, 2022
734ec8f
Change to Java 11 (#269)
wog48 Nov 3, 2022
da93752
Update README.md (#270)
wog48 Nov 3, 2022
dd3ff96
Defect/count not working on hana (#271)
wog48 Nov 3, 2022
97f2208
Defect/java function parameter name (#272)
wog48 Nov 20, 2022
e488a46
Raise message in case of Void as return type for functions (#273)
wog48 Nov 21, 2022
2c3c4a6
Extension of visitor for java functions (#274)
wog48 Dec 4, 2022
96f2d50
Update version to 1.1.1 (#275)
wog48 Dec 14, 2022
10e1dec
Feature/predefined annotations (#276)
wog48 Dec 22, 2022
89deaae
Add page to order by builder (#277)
wog48 Dec 30, 2022
614b5ee
Feature/predefined annotations (#278)
wog48 Jan 15, 2023
11e6aad
Feature/predefined annotations (#279)
wog48 Jan 15, 2023
65d13c8
Feature/predefined annotations (#280)
wog48 Jan 15, 2023
56e9763
Update .xmake.cfg (#283)
wog48 Feb 12, 2023
8f6e3ff
Correct spelling (#281)
wog48 Feb 12, 2023
893d715
Feature/predefined annotations (#282)
wog48 Feb 18, 2023
af2b0f2
Update .xmake.cfg (#284)
wog48 Feb 20, 2023
ed3f488
Feature/predefined annotations (#286)
wog48 Apr 28, 2023
c0f0967
Feature/predefined annotations (#287)
wog48 May 13, 2023
dea342b
Clean-up pom and typo correction (#288)
wog48 May 24, 2023
29dd8d0
Solve issue 212 and fix permission check issue with join tables (#289)
wog48 Jun 10, 2023
6cb20b2
Fix issue, converting type (#290)
wog48 Jun 25, 2023
997a704
Multi step Mapped Superclass (#291)
wog48 Jun 25, 2023
e87c8c4
Upgrade H2 to 2.2.220 (#293)
wog48 Jul 10, 2023
05c8926
Correct navigation to one is null (#294)
wog48 Aug 6, 2023
176db5b
Fix join column determination with cyclic dependency (#295)
wog48 Aug 10, 2023
7fea8d2
Make OneToOne required and handle non JPA Processor errors in metadat…
wog48 Sep 3, 2023
7363173
Defect/issue214 (#297)
wog48 Sep 4, 2023
68a964f
Defect/issue214 (#298)
wog48 Sep 5, 2023
256c33d
Update .xmake.cfg (#300)
wog48 Sep 7, 2023
e3fa961
Update version to 2.0.0 (#299)
wog48 Oct 2, 2023
091b2b4
Defect/issue226 (#301)
wog48 Nov 11, 2023
005c85a
First level of COUNT query as IN (#302)
wog48 Nov 24, 2023
cf11992
Defect/issues239 (#303)
wog48 Nov 24, 2023
9fa771b
Defect/issues239 (#304)
wog48 Nov 27, 2023
7b8bc8f
Rename properties file to prevent name clashes (#305)
wog48 Nov 27, 2023
6b799c7
Clean-up pom and some code (#306)
wog48 Dec 3, 2023
30b7634
Defect/pom cleanup (#307)
wog48 Dec 3, 2023
c3f1307
Archetype and SOnar clean-up (#308)
wog48 Dec 5, 2023
0577fa8
Add protection where to collection query (#309)
wog48 Dec 5, 2023
93a4e79
Check if cast is necessary (#310)
wog48 Dec 6, 2023
5904b7c
Set version to 2.0.2 (#311)
wog48 Dec 6, 2023
128cf55
Update to Olingo 5.0.0 and remove wrapper (#314)
wog48 Dec 19, 2023
23b832a
Extend interface for server driven paging (#313)
wog48 Jan 7, 2024
229ee76
Feature/enhancement of paging (#315)
wog48 Jan 16, 2024
5bd45a6
First version and some clean-ups (#312)
wog48 Jan 16, 2024
22232b5
New query implementation for count (#316)
wog48 Jan 28, 2024
b67bc6f
Feature/annotation api extension (#317)
wog48 Jan 30, 2024
6dc289e
Update project files (#318)
wog48 Feb 7, 2024
819b7c0
Add null check for NOT IN clauses (#319)
wog48 Feb 9, 2024
28e752a
Fix $count problem with collection properties (#320)
wog48 Feb 17, 2024
ec54a08
Defect/use raw uri for vocabularies (#321)
wog48 Feb 27, 2024
9571aec
Defect/use raw uri for vocabularies (#322)
wog48 Feb 28, 2024
900096f
Defect/missing paging expand with cp (#323)
wog48 Mar 3, 2024
cd35566
Handle LIMIT and OFFSET with TypedQuery (#324)
wog48 Mar 25, 2024
91ebd6e
Defect/eclipse link hana problem (#325)
wog48 Mar 26, 2024
30ec04d
Check restrictions on IN clause (#326)
wog48 Apr 9, 2024
34d65ac
Correct NPE if enum property is nullable (#327)
wog48 Apr 16, 2024
38ae3d2
Update README.md (#328)
wog48 Apr 16, 2024
1a9a1dc
Update version to 2.2.0-SNAPSHOT
wog48 Apr 24, 2024
3513f0d
Fix duplicates result multi expands issue#292 (#329)
wog48 May 15, 2024
cc5a615
Defect/enumeration convertion error (#330)
wog48 May 17, 2024
9e0fb4b
Suppress generation of defaults for LIMIT and OFFSET (#331)
wog48 May 21, 2024
3e300cb
Enable order by to one associations (#333)
wog48 Jun 8, 2024
f1a2e29
Enhanced ETag handling for GET entity set requests (#332)
wog48 Jun 15, 2024
8d44a41
Defect/orderby navigation to on (#334)
wog48 Jun 16, 2024
45db05b
Correct collection property select clause issues (#335)
wog48 Jun 19, 2024
5e4df67
Enable nested lambda expressions (#336)
wog48 Jun 21, 2024
545adb6
Fix problem with expand and lambda to collection (#337)
wog48 Jun 21, 2024
c422895
Set version to 2.1.3 (#338)
wog48 Jun 23, 2024
6c00c37
Feature/release 2.1.3 (#339)
wog48 Jun 27, 2024
f3b6cad
Feature/release 2.1.3 (#340)
wog48 Jun 29, 2024
c036f5e
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Jun 29, 2024
e4bdcc5
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Jun 29, 2024
7cae220
Update to version 2.1.4 (#341)
wog48 Jun 30, 2024
1010db0
Update to version 2.2.0 (#342)
wog48 Jun 30, 2024
7aae7d6
Defect/issue 330 (#343)
wog48 Jun 30, 2024
4c3b74e
Defect/issue 330 (#344)
wog48 Jul 9, 2024
71d5506
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Aug 5, 2024
c7a8f00
Fix issue with orderby and description properties (#345)
wog48 Aug 5, 2024
4603826
Add test
wog48 Aug 5, 2024
1133c06
Update gitignore
wog48 Aug 5, 2024
d40093f
Merge remote-tracking branch 'jpa-processor/master' into
wog48 Aug 5, 2024
b900c76
Handle missed changes
wog48 Aug 6, 2024
c58d6e8
clean-up
wog48 Aug 6, 2024
02015ea
Update artifact pom
wog48 Aug 6, 2024
8743f83
Clean-up duplicate code
wog48 Aug 6, 2024
2286cb2
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Sep 10, 2024
1249108
server driven paging on expand (#346)
wog48 Sep 19, 2024
74cd571
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Sep 19, 2024
56b32c9
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Sep 19, 2024
bc347b7
Update create response (#347)
wog48 Sep 22, 2024
78a57bf
Merge remote-tracking branch 'jpa-processor/master' into feature/vers…
wog48 Sep 22, 2024
8b02ac4
Merge branch 'main' into feature/version-2.2.0
wog48 Sep 22, 2024
e59136a
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Sep 22, 2024
9c189f7
Merge remote-tracking branch 'public/feature/version-2.2.0' into feat…
wog48 Sep 22, 2024
31b2988
Feature/server driven paging expand (#348)
wog48 Sep 22, 2024
d6ee6fa
Merge remote-tracking branch 'jpa-processor/master' into feature/vers…
wog48 Sep 22, 2024
df0ef32
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Sep 23, 2024
ed25d28
Feature/server driven paging expand (#349)
wog48 Oct 6, 2024
a3bdff6
Merge remote-tracking branch 'public/main' into feature/version-2.2.0
wog48 Oct 6, 2024
c7a9049
Update pom
wog48 Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jpa-archetype/odata-jpa-archetype-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<configuration>
<debug>true</debug>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ void checkAnnotations() throws ODataJPAModelException {

@Test
void checkPostProcessorCalled() throws ODataJPAModelException {
// PostProcessorSpy spy = new PostProcessorSpy();
IntermediateModelElement.setPostProcessor(processor);
final Attribute<?, ?> jpaAttribute = helper.getDeclaredAttribute(helper.getEmbeddableType("PostalAddressData"),
"countryName");
Expand All @@ -285,35 +284,31 @@ void checkPostProcessorAnnotationAdded() throws ODataJPAModelException {
@Test
void checkEmptyAssociationThrowsException() throws ODataJPAModelException {

final IntermediateDescriptionProperty cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(
false, false, 0), et, helper.schema);
cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(false, false, 0), et, helper.schema);
final ODataJPAModelException act = assertThrows(ODataJPAModelException.class, () -> cut.lazyBuildEdmItem());
assertEquals(ODataJPAModelException.MessageKeys.DESCRIPTION_ANNOTATION_MISSING.getKey(), act.getId());
}

@Test
void checkUnknownAttributeAtTargetThrowsException() throws ODataJPAModelException {

final IntermediateDescriptionProperty cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(
true, false, 0), et, helper.schema);
cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(true, false, 0), et, helper.schema);
final ODataJPAModelException act = assertThrows(ODataJPAModelException.class, () -> cut.lazyBuildEdmItem());
assertEquals(ODataJPAModelException.MessageKeys.INVALID_DESCRIPTION_PROPERTY.getKey(), act.getId());
}

@Test
void checkNoLocationAtTargetThrowsException() throws ODataJPAModelException {

final IntermediateDescriptionProperty cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(
true, true, 0), et, helper.schema);
cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(true, true, 0), et, helper.schema);
final ODataJPAModelException act = assertThrows(ODataJPAModelException.class, () -> cut.lazyBuildEdmItem());
assertEquals(ODataJPAModelException.MessageKeys.DESCRIPTION_LOCALE_FIELD_MISSING.getKey(), act.getId());
}

@Test
void checkLocationAndLanguageAtTargetThrowsException() throws ODataJPAModelException {

final IntermediateDescriptionProperty cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(
true, true, 2), et, helper.schema);
cut = new IntermediateDescriptionProperty(nameBuilder, createAttributeMock(true, true, 2), et, helper.schema);
final ODataJPAModelException act = assertThrows(ODataJPAModelException.class, () -> cut.lazyBuildEdmItem());
assertEquals(ODataJPAModelException.MessageKeys.DESCRIPTION_LOCALE_FIELD_MISSING.getKey(), act.getId());
}
Expand Down Expand Up @@ -393,17 +388,24 @@ void checkPathHasJoinTableNull() throws ODataJPAModelException {
assertNull(act.getJoinTable());
}

private class PostProcessorSetName implements JPAEdmMetadataPostProcessor {
@Test
void checkPathGetForeignKeyColumns() throws ODataJPAModelException {
createDefaultCut();
final var act = cut.getPath().getForeignKeyColumns();
assertNotNull(act);
assertTrue(act.isEmpty());
}

private static class PostProcessorSetName implements JPAEdmMetadataPostProcessor {

@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
if (jpaManagedTypeClassName.equals(ADDR_CANONICAL_NAME)) {
if (property.getInternalName().equals("countryName")) {
final CsdlAnnotation annotation = new CsdlAnnotation();
annotation.setTerm("Immutable");
annotation.setExpression(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"));
property.addAnnotations(Collections.singletonList(annotation));
}
if (jpaManagedTypeClassName.equals(ADDR_CANONICAL_NAME)
&& property.getInternalName().equals("countryName")) {
final CsdlAnnotation annotation = new CsdlAnnotation();
annotation.setTerm("Immutable");
annotation.setExpression(new CsdlConstantExpression(ConstantExpressionType.Bool, "true"));
property.addAnnotations(Collections.singletonList(annotation));
}
}

Expand All @@ -430,7 +432,7 @@ private void createDefaultCut() throws ODataJPAModelException {
}

private Attribute<?, ?> createAttributeMock(final boolean association, final boolean associationName,
final int langFields) {
final int languageFields) {
final Attribute<?, ?> attribute = mock(Attribute.class);
final ManagedType<?> managedType = mock(ManagedType.class);
final Member member = mock(AnnotatedMember.class);
Expand Down Expand Up @@ -461,9 +463,9 @@ public Class<BusinessPartner> answer(final InvocationOnMock invocation) throws T
when(((AnnotatedElement) member).getAnnotation(EdmDescriptionAssociation.class)).thenReturn(a);
if (associationName)
when(a.descriptionAttribute()).thenReturn("name");
if (langFields > 0)
if (languageFields > 0)
when(a.languageAttribute()).thenReturn("language");
if (langFields > 1)
if (languageFields > 1)
when(a.localeAttribute()).thenReturn("location");
}
return attribute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@

import org.apache.olingo.server.api.uri.UriInfoResource;

/**
* A page in case a the amount of returned data shall be restricted by the server.
*
* @param uriInfo UriInfoResource of the original request
* @param skip Skip value to be used
* @param top Top value to be used
* @param skipToken The skip token to be used in the next link for non expand requests.
* @param expandInformation Provides for pages of restricted expand requests the path and key information needed to build the
* next
* request.
*
*/
public record JPAODataPage(UriInfoResource uriInfo, int skip, int top, Object skipToken,
List<JPAODataPageExpandInfo> expandInfo) {
List<JPAODataPageExpandInfo> expandInformation) {

public JPAODataPage(final UriInfoResource uriInfo, final int skip, final int top, final Object skipToken) {
this(uriInfo, skip, top, skipToken, Collections.emptyList());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package com.sap.olingo.jpa.processor.core.api;

/**
*
* @param navigationPropertyPath Concatenated path information leading to the next expand
* @param keyPath Concatenated key information to be used to convert the expand
*
* @author Oliver Grande
* @since 2.2.0
*
*/
public record JPAODataPageExpandInfo(String navigationPropertyPath, String keyPath) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ default JPAODataPage getFirstPage(final UriInfo uriInfo, @Nullable final Integer
* @param uriInfo
* @param preferredPageSize Value of the odata.maxpagesize preference header
* @param countQuery A query that can be used to determine the maximum number of results that can be
* expected. Only if the number of expected results is bigger then the page size a next link
* expected. Only if the number of expected results is bigger then the page size a page should be generated.
* @param em An instance of the entity manager
* @return An optional of the page that shall be read. In case the optional is empty, all records are read from the
* database.
Expand All @@ -98,11 +98,12 @@ default Optional<JPAODataPage> getFirstPage(final JPARequestParameterMap request
/**
* Requires module {@code odata-jpa-processor-cb}
* @param requestParameter The parameter from the request context
* @param pathInformation
* @param uriInfo
* @param association
* @param pathInformation Fragmented string representation of the URI, to be able to rebuild the uri info.
* @param uriInfo Java representation of the request URI
* @param association Metadata of the
* @param preferredPageSize
* @param count
* @param count A query that can be used to determine the maximum number of results that can be
* expected per parent. Only if the number of expected results is bigger then the page size a page should be generated.
* @param em An instance of the entity manager
* @return
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,6 @@ public Optional<EdmQueryExtensionProvider> getQueryEnhancement(@Nonnull final JP
public JPAODataEtagHelper getEtagHelper();

public Optional<JPAODataPagingProvider> getPagingProvider();

public JPAODataPathInformation getPathInformation();
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public <K extends Comparable<K>> void retrieveData(final ODataRequest request, f
final ContentType responseFormat) throws ODataException {

try (var measurement = debugger.newMeasurement(this, "retrieveData")) {

checkRequestSupported();
// Create a JPQL Query and execute it
JPAJoinQuery query = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.sap.olingo.jpa.processor.core.api.JPAODataEtagHelper;
import com.sap.olingo.jpa.processor.core.api.JPAODataGroupProvider;
import com.sap.olingo.jpa.processor.core.api.JPAODataPagingProvider;
import com.sap.olingo.jpa.processor.core.api.JPAODataPathInformation;
import com.sap.olingo.jpa.processor.core.api.JPAODataQueryDirectives;
import com.sap.olingo.jpa.processor.core.api.JPAODataRequestContext;
import com.sap.olingo.jpa.processor.core.api.JPAODataRequestContextAccess;
Expand Down Expand Up @@ -71,6 +72,7 @@ public final class JPAODataInternalRequestContext implements JPAODataRequestCont
private JPAODataQueryDirectives queryDirectives;
private JPAODataEtagHelper etagHelper;
private Optional<JPAODataPagingProvider> pagingProvider;
private JPAODataPathInformation pathInformation;

public JPAODataInternalRequestContext(@Nonnull final JPAODataRequestContext requestContext,
@Nonnull final JPAODataSessionContextAccess sessionContext, final OData odata) {
Expand All @@ -89,7 +91,7 @@ public JPAODataInternalRequestContext(@Nonnull final JPAODataRequestContext requ
*/
public JPAODataInternalRequestContext(final UriInfoResource uriInfo, final JPAODataRequestContextAccess context)
throws ODataJPAProcessorException {
this(uriInfo, null, context, context.getHeader());
this(uriInfo, null, context, context.getHeader(), null);
}

/**
Expand All @@ -100,11 +102,12 @@ public JPAODataInternalRequestContext(final UriInfoResource uriInfo, final JPAOD
*/
public JPAODataInternalRequestContext(final UriInfoResource uriInfo, final JPAODataRequestContextAccess context,
final Map<String, List<String>> header) throws ODataJPAProcessorException {
this(uriInfo, null, context, header);
this(uriInfo, null, context, header, null);
}

JPAODataInternalRequestContext(final UriInfoResource uriInfo, @Nullable final JPASerializer serializer,
final JPAODataRequestContextAccess context, final Map<String, List<String>> header)
final JPAODataRequestContextAccess context, final Map<String, List<String>> header,
final JPAODataPathInformation pathInformation)
throws ODataJPAProcessorException {

copyContextValues(context);
Expand All @@ -115,6 +118,7 @@ public JPAODataInternalRequestContext(final UriInfoResource uriInfo, final JPAOD
this.header = new JPAHttpHeaderHashMap(header);
this.customParameter = new JPARequestParameterHashMap(context.getRequestParameter());
this.hookFactory = new JPAHookFactory(em, this.header, customParameter);
this.pathInformation = pathInformation != null ? pathInformation : this.pathInformation;
}

@Override
Expand Down Expand Up @@ -248,6 +252,11 @@ public Optional<JPAODataPagingProvider> getPagingProvider() {
return pagingProvider;
}

@Override
public JPAODataPathInformation getPathInformation() {
return pathInformation;
}

private void copyContextValues(final JPAODataRequestContextAccess context)
throws ODataJPAProcessorException {
this.em = context.getEntityManager();
Expand All @@ -264,6 +273,7 @@ private void copyContextValues(final JPAODataRequestContextAccess context)
this.queryDirectives = context.getQueryDirectives();
this.etagHelper = context.getEtagHelper();
this.pagingProvider = context.getPagingProvider();
this.pathInformation = context.getPathInformation();
}

private void copyRequestContext(@Nonnull final JPAODataRequestContext requestContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public JPACUDRequestProcessor createCUDRequestProcessor(final UriInfo uriInfo, f

final JPAODataRequestContextAccess requestContext = new JPAODataInternalRequestContext(uriInfo, serializerFactory
.createCUDSerializer(responseFormat, uriInfo, Optional.ofNullable(header.get(HttpHeader.ODATA_MAX_VERSION))),
context, header);
context, header, null);

return new JPACUDRequestProcessor(odata, serviceMetadata, requestContext, new JPAConversionHelper());
}
Expand All @@ -73,7 +73,7 @@ public JPAActionRequestProcessor createActionProcessor(final UriInfo uriInfo, fi

final JPAODataRequestContextAccess requestContext = new JPAODataInternalRequestContext(uriInfo,
responseFormat != null ? serializerFactory.createSerializer(responseFormat, uriInfo, Optional.ofNullable(header
.get(HttpHeader.ODATA_MAX_VERSION))) : null, context, header);
.get(HttpHeader.ODATA_MAX_VERSION))) : null, context, header, null);

return new JPAActionRequestProcessor(odata, requestContext);

Expand All @@ -88,7 +88,7 @@ public JPARequestProcessor createProcessor(final UriInfo uriInfo, final ContentT

final JPAODataRequestContextAccess requestContext = new JPAODataInternalRequestContext(newUriInfo, serializerFactory
.createSerializer(responseFormat, newUriInfo, Optional.ofNullable(header.get(
HttpHeader.ODATA_MAX_VERSION))), context, header);
HttpHeader.ODATA_MAX_VERSION))), context, header, pathInformation);

return switch (newUriInfo.getLastResourcePart().getKind()) {
case count -> new JPACountRequestProcessor(odata, requestContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public List<JPAExpandItemInfo> buildExpandItemInfo(final JPAServiceDocument sd,
final Optional<JPAODataExpandPage> page;
if (provider.isPresent())
page = provider.get().getFirstPageExpand(requestContext.getRequestParameter(),
null, requestContext.getUriInfo(), item.getKey().getTopOption(), item.getKey().getSkipOption(),
requestContext.getPathInformation(), requestContext.getUriInfo(), item.getKey().getTopOption(), item
.getKey().getSkipOption(),
item.getValue().getLeaf(), count, requestContext.getEntityManager());
else
page = Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ public JPAUriInfoFactory(@Nonnull final JPAODataPage page) {
}

public JPAUriInfoResource build() {
if (page.expandInfo().isEmpty())
if (page.expandInformation().isEmpty())
// Standard pagination not resolving the $levels, as JPA Processor supports ODatas max option,
// so depth is not known up-front and a late resolution has to be done anyhow. This also prevent the early
// resolution of *
return new JPAUriInfoBuilder(page.uriInfo())
// .withResolvedStars()
.withTop(page.top())
.withSkip(page.skip())
.withSkipToken(page.skipToken())
.build();
else
return new JPAUriInfoBuilder(page.uriInfo())
.withResolvedStars(page.expandInfo())
.withExpandInfo(page.expandInfo())
.withResolvedStars(page.expandInformation())
.withExpandInfo(page.expandInformation())
.withExpandOrderBy()
.withTop(page.top())
.withSkip(page.skip())
.withSkipToken(page.skipToken())
.build();
}

Expand Down
Loading