Skip to content

Commit 50656de

Browse files
committed
Try fix CI issues
1 parent c2b38f8 commit 50656de

File tree

49 files changed

+816
-304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+816
-304
lines changed

.github/workflows/ci.yaml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ jobs:
4848
jdk: 17
4949
native: true
5050
################################################
51-
# Test different spring-data and deltaspike versions
52-
################################################
53-
- rdbms: h2
54-
provider: hibernate-6.6
55-
jdk: 17
56-
spring-data: spring-data-3.3.x
57-
################################################
5851
# A Hibernate 6.6 profile that also runs the entity-view-annotation-processor
5952
################################################
6053
- rdbms: postgresql
@@ -74,26 +67,22 @@ jobs:
7467
- rdbms: h2
7568
provider: hibernate-6.2
7669
jdk: 17
77-
spring-data: spring-data-3.1.x
70+
spring-data: spring-data-3.2.x
7871

7972
################################################
8073
# hibernate-6.4
8174
################################################
8275
- rdbms: h2
8376
provider: hibernate-6.4
8477
jdk: 17
85-
spring-data: spring-data-3.2.x
78+
spring-data: spring-data-3.3.x
8679
################################################
8780
# hibernate-6.6
8881
################################################
8982
- rdbms: h2
9083
provider: hibernate-6.6
9184
jdk: 17
9285
spring-data: spring-data-3.4.x
93-
- rdbms: h2
94-
provider: hibernate-6.6
95-
jdk: 17
96-
spring-data: spring-data-3.5.x
9786
################################################
9887
# hibernate-7.1
9988
################################################
@@ -115,9 +104,6 @@ jobs:
115104
provider: hibernate-6.6
116105
jdk: 17
117106
build-jdk: 17
118-
################################################
119-
# Latest GA JDK
120-
################################################
121107
- rdbms: h2
122108
provider: hibernate-6.6
123109
jdk: 21
@@ -126,15 +112,27 @@ jobs:
126112
jdk: 21
127113
build-jdk: 21
128114
################################################
115+
# Latest GA JDK
116+
################################################
117+
- rdbms: h2
118+
provider: hibernate-7.2
119+
jdk: 25
120+
spring-data: spring-data-4.0.x
121+
- rdbms: h2
122+
provider: hibernate-7.2
123+
jdk: 25
124+
build-jdk: 25
125+
spring-data: spring-data-4.0.x
126+
################################################
129127
# Early access JDKs
130128
################################################
131129
# - rdbms: h2
132130
# provider: hibernate-6.6
133-
# jdk: 22-ea
131+
# jdk: 26-ea
134132
# - rdbms: h2
135133
# provider: hibernate-6.6
136-
# jdk: 22-ea
137-
# build-jdk: 22-ea
134+
# jdk: 26-ea
135+
# build-jdk: 26-ea
138136
steps:
139137
- uses: actions/checkout@v4
140138
- name: Update /etc/hosts file
@@ -161,19 +159,32 @@ jobs:
161159
java-version: ${{ matrix.jdk }}
162160
distribution: 'zulu'
163161

164-
- name: Get year/month for cache key
165-
id: get-date
162+
- name: Generate cache key
163+
id: cache-key
166164
run: |
167-
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
168-
shell: bash
165+
CURRENT_BRANCH="${{ github.repository != 'Blazebit/blaze-persistence' && 'fork' || github.base_ref || github.ref_name }}"
166+
CURRENT_MONTH=$(/bin/date -u "+%Y-%m")
167+
CURRENT_DAY=$(/bin/date -u "+%d")
168+
ROOT_CACHE_KEY="buildtool-cache"
169+
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
170+
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
171+
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
169172
- name: Cache Maven local repository
170173
uses: actions/cache@v4
171174
id: cache-maven
175+
# if it's not a pull request, we restore and save the cache
176+
if: github.event_name != 'pull_request'
172177
with:
173178
path: |
174-
~/.m2/repository
175-
# refresh cache every month to avoid unlimited growth
176-
key: maven-localrepo-${{ steps.get-date.outputs.yearmonth }}
179+
~/.m2/repository/
180+
~/.m2/wrapper/
181+
# A new cache will be stored daily. After that first store of the day, cache save actions will fail because the cache is immutable but it's not a problem.
182+
# The whole cache is dropped monthly to prevent unlimited growth.
183+
# The cache is per branch but in case we don't find a branch for a given branch, we will get a cache from another branch.
184+
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
185+
restore-keys: |
186+
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
187+
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
177188
- name: Set up Maven
178189
run: ./mvnw -v
179190

build.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,14 @@ if [[ "$BUILD_JDK" != "" ]]; then
2929
export BUILD_JDK=${BUILD_JDK::-3}
3030
fi
3131
PROPERTIES="$PROPERTIES -Dmain.java.version=$BUILD_JDK -Dtest.java.version=$BUILD_JDK"
32-
if [[ "$BUILD_JDK" == "21" ]] || [[ "$BUILD_JDK" == "22" ]]; then
32+
if [[ "$BUILD_JDK" == "21" ]] || [[ "$BUILD_JDK" == "25" ]] || [[ "$BUILD_JDK" == "26" ]]; then
3333
# Until Deltaspike releases a version with ASM 9.5, we have to exclude these parts from the build
3434
PROPERTIES="-pl !integration/deltaspike-data/testsuite $PROPERTIES"
3535
fi
3636
fi
3737

38-
if [[ "$JDK" != "" ]]; then
39-
if [[ "$JDK" == *-ea ]]; then
40-
export JDK=${JDK::-3}
41-
fi
42-
if [[ "$JDK" == "21" ]] || [[ "$JDK" == "22" ]]; then
43-
# As of JDK 21 Javac produces parameter attributes with a null name that old BND versions can't read
44-
PROPERTIES="$PROPERTIES -Dversion.bnd=7.0.0"
45-
fi
46-
fi
47-
4838
if [[ "$NATIVE" == "true" ]]; then
49-
exec $DIR/mvnw -B -P ${JPAPROVIDER},${RDBMS},${SPRING_DATA:-spring-data-3.3.x},${DELTASPIKE:-deltaspike-2.0},native${ADDITIONAL_PROFILES} clean install -am -V $PROPERTIES
39+
exec $DIR/mvnw -B -P ${JPAPROVIDER},${RDBMS},${SPRING_DATA:-spring-data-3.5.x},${DELTASPIKE:-deltaspike-2.0},native${ADDITIONAL_PROFILES} clean install -am -V $PROPERTIES
5040
else
51-
exec $DIR/mvnw -B -P ${JPAPROVIDER},${RDBMS},${SPRING_DATA:-spring-data-3.3.x},${DELTASPIKE:-deltaspike-2.0}${ADDITIONAL_PROFILES} clean install -am -V $PROPERTIES
41+
exec $DIR/mvnw -B -P ${JPAPROVIDER},${RDBMS},${SPRING_DATA:-spring-data-3.5.x},${DELTASPIKE:-deltaspike-2.0}${ADDITIONAL_PROFILES} clean install -am -V $PROPERTIES
5242
fi

core/testsuite-hibernate/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
<reportsDirectory>${project.build.directory}/surefire-reports/${surefire.forkNumber}</reportsDirectory>
254254
<excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoOracle,${jpa.excludedGroups}</excludedGroups>
255255
<systemPropertyVariables>
256-
<jdbc.url>jdbc:oracle:thin:@${dbHost}:1521:XE</jdbc.url>
256+
<jdbc.url>jdbc:oracle:thin:@//${dbHost}:1521/freepdb1</jdbc.url>
257257
<jdbc.user>SYSTEM</jdbc.user>
258258
<jdbc.password>Oracle18</jdbc.password>
259259
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
@@ -647,7 +647,7 @@
647647
<id>hibernate-7.1</id>
648648
<properties>
649649
<jpa-api-version>${version.jakarta-jpa-3.2-api}</jpa-api-version>
650-
<jpa.excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70</jpa.excludedGroups>
650+
<jpa.excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70</jpa.excludedGroups>
651651
</properties>
652652
<dependencies>
653653
<dependency>
@@ -748,7 +748,7 @@
748748
<id>hibernate-7.2</id>
749749
<properties>
750750
<jpa-api-version>${version.jakarta-jpa-3.2-api}</jpa-api-version>
751-
<jpa.excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70</jpa.excludedGroups>
751+
<jpa.excludedGroups>com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70</jpa.excludedGroups>
752752
</properties>
753753
<dependencies>
754754
<dependency>

core/testsuite-hibernate/src/test/java/com/blazebit/persistence/testsuite/hibernate/Issue1167Test.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package com.blazebit.persistence.testsuite.hibernate;
77

8+
import org.hibernate.annotations.SQLRestriction;
89
import org.hibernate.annotations.Where;
910
import org.junit.Test;
1011

@@ -27,6 +28,7 @@ protected Class<?>[] getEntityClasses() {
2728

2829
@Entity(name = "BasicEntity")
2930
@Where(clause = "deleted_char <> 't'")
31+
@SQLRestriction("deleted_char <> 't'")
3032
public static class BasicEntity {
3133
@Id
3234
Long id;

core/testsuite-hibernate/src/test/java/com/blazebit/persistence/testsuite/hibernate/Issue1436Test.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import jakarta.persistence.ManyToOne;
1717
import java.io.Serializable;
1818

19+
import org.hibernate.annotations.processing.Exclude;
20+
1921
import static org.junit.Assert.assertEquals;
2022

2123
/**
@@ -38,6 +40,7 @@ public void testBuild() {
3840
}
3941

4042
@Entity
43+
@Exclude
4144
public static class Item implements Serializable {
4245
@Id
4346
Long id1;
@@ -49,6 +52,7 @@ public Item() {
4952
}
5053

5154
@Entity
55+
@Exclude
5256
public static class OrderItem implements Serializable {
5357
@Id
5458
Long id;

core/testsuite-hibernate/src/test/java/com/blazebit/persistence/testsuite/hibernate/Issue1704Test.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.List;
1010
import java.util.Set;
1111

12+
import org.hibernate.annotations.SQLRestriction;
1213
import org.hibernate.annotations.Where;
1314

1415
import org.junit.Assert;
@@ -67,6 +68,7 @@ public void work(EntityManager em) {
6768

6869
@Entity(name = "WhereEntity")
6970
@Where(clause = "0=0")
71+
@SQLRestriction("0=0")
7072
public static class WhereEntity {
7173

7274
private Long id;

core/testsuite-hibernate/src/test/java/com/blazebit/persistence/testsuite/hibernate/Issue519Test.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import org.hibernate.annotations.Generated;
1212
import org.hibernate.annotations.GenerationTime;
1313
import org.hibernate.annotations.Subselect;
14+
import org.hibernate.generator.EventType;
15+
1416
import org.junit.Test;
1517

1618
import jakarta.persistence.Column;
@@ -74,7 +76,7 @@ public static class A {
7476
@Id
7577
private Long id;
7678

77-
@Generated(GenerationTime.INSERT)
79+
@Generated(value = GenerationTime.INSERT, event = EventType.INSERT)
7880
@OneToOne(mappedBy = "a")
7981
private B b;
8082

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright Blazebit
4+
*/
5+
6+
package org.hibernate.annotations;
7+
8+
import java.lang.annotation.Retention;
9+
import java.lang.annotation.Target;
10+
11+
import org.hibernate.generator.EventType;
12+
13+
import static java.lang.annotation.ElementType.FIELD;
14+
import static java.lang.annotation.ElementType.METHOD;
15+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
16+
import static org.hibernate.generator.EventType.INSERT;
17+
18+
@Target( {FIELD, METHOD} )
19+
@Retention( RUNTIME )
20+
public @interface Generated {
21+
EventType[] event() default INSERT;
22+
@Deprecated(since = "6.2")
23+
GenerationTime value() default GenerationTime.INSERT;
24+
String sql() default "";
25+
boolean writable() default false;
26+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright Blazebit
4+
*/
5+
6+
package org.hibernate.annotations;
7+
8+
public enum GenerationTime {
9+
NEVER,
10+
INSERT,
11+
UPDATE,
12+
ALWAYS;
13+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright Blazebit
4+
*/
5+
6+
package org.hibernate.annotations;
7+
8+
import java.lang.annotation.Retention;
9+
import java.lang.annotation.Target;
10+
11+
import static java.lang.annotation.ElementType.FIELD;
12+
import static java.lang.annotation.ElementType.METHOD;
13+
import static java.lang.annotation.ElementType.TYPE;
14+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
15+
16+
@Target({TYPE, METHOD, FIELD})
17+
@Retention(RUNTIME)
18+
public @interface SQLRestriction {
19+
String value();
20+
}

0 commit comments

Comments
 (0)