Skip to content

Commit cc3761a

Browse files
authored
Merge pull request #34062 from njr-11/update-api-to-m2
Sync 1.1 API with latest from M2
2 parents 0d34962 + 112c057 commit cc3761a

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 IBM Corporation and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License 2.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* IBM Corporation - initial API and implementation
12+
*******************************************************************************/
13+
package jakarta.data.event;
14+
15+
public class PostUpsertEvent<E> extends LifecycleEvent<E> {
16+
17+
public PostUpsertEvent(E entity) {
18+
super(entity);
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 IBM Corporation and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License 2.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* IBM Corporation - initial API and implementation
12+
*******************************************************************************/
13+
package jakarta.data.event;
14+
15+
public class PreUpsertEvent<E> extends LifecycleEvent<E> {
16+
17+
public PreUpsertEvent(E entity) {
18+
super(entity);
19+
}
20+
}

dev/io.openliberty.jakarta.data.1.1/src/jakarta/data/page/impl/CursoredPageRecord.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 IBM Corporation and others.
2+
* Copyright (c) 2024,2026 IBM Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -33,6 +33,20 @@ public record CursoredPageRecord<T>(
3333
PageRequest previousPageRequest)
3434
implements CursoredPage<T> {
3535

36+
public CursoredPageRecord(List<T> content,
37+
List<Cursor> cursors,
38+
long totalElements,
39+
PageRequest pageRequest,
40+
PageRequest nextPageRequest,
41+
PageRequest previousPageRequest) {
42+
this.content = List.copyOf(content);
43+
this.cursors = List.copyOf(cursors);
44+
this.nextPageRequest = nextPageRequest;
45+
this.pageRequest = pageRequest;
46+
this.previousPageRequest = previousPageRequest;
47+
this.totalElements = totalElements;
48+
}
49+
3650
public CursoredPageRecord(List<T> content,
3751
List<PageRequest.Cursor> cursors,
3852
long totalElements,

dev/io.openliberty.jakarta.data.1.1/src/jakarta/data/page/impl/PageRecord.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 IBM Corporation and others.
2+
* Copyright (c) 2024,2026 IBM Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -29,6 +29,16 @@ public record PageRecord<T>(PageRequest pageRequest,
2929
boolean moreResults)
3030
implements Page<T> {
3131

32+
public PageRecord(PageRequest pageRequest,
33+
List<T> content,
34+
long totalElements,
35+
boolean moreResults) {
36+
this.content = List.copyOf(content);
37+
this.moreResults = moreResults;
38+
this.pageRequest = pageRequest;
39+
this.totalElements = totalElements;
40+
}
41+
3242
public PageRecord(PageRequest req,
3343
List<T> content,
3444
long total) {

0 commit comments

Comments
 (0)