File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
main/java/org/springframework/data/jpa/repository/aot
test/java/org/springframework/data/jpa/repository/aot Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 3333import org .hibernate .cfg .PersistenceSettings ;
3434import org .hibernate .cfg .QuerySettings ;
3535import org .hibernate .dialect .Dialect ;
36+ import org .hibernate .dialect .sequence .ANSISequenceSupport ;
37+ import org .hibernate .dialect .sequence .SequenceSupport ;
3638import org .hibernate .engine .jdbc .connections .internal .UserSuppliedConnectionProviderImpl ;
3739import org .hibernate .jpa .HibernatePersistenceProvider ;
3840import org .hibernate .jpa .boot .internal .EntityManagerFactoryBuilderImpl ;
@@ -137,7 +139,14 @@ public EntityManagerFactory getEntityManagerFactory() {
137139 */
138140 @ SuppressWarnings ("deprecation" )
139141 static class SpringDataJpaAotDialect extends Dialect {
142+
140143 static SpringDataJpaAotDialect INSTANCE = new SpringDataJpaAotDialect ();
144+
145+ @ Override
146+ public SequenceSupport getSequenceSupport () {
147+ return ANSISequenceSupport .INSTANCE ;
148+ }
149+
141150 }
142151
143152}
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2025 the original author or authors.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package org .springframework .data .jpa .repository .aot ;
17+
18+ import static org .assertj .core .api .Assertions .*;
19+
20+ import org .junit .jupiter .api .Test ;
21+
22+ /**
23+ * Unit tests for {@link AotMetamodel}.
24+ *
25+ * @author Mark Paluch
26+ */
27+ class AotMetamodelUnitTests {
28+
29+ @ Test // GH-4103
30+ void dialectSupportsSequences () {
31+ assertThat (AotMetamodel .SpringDataJpaAotDialect .INSTANCE .getSequenceSupport ().supportsSequences ()).isTrue ();
32+ assertThat (AotMetamodel .SpringDataJpaAotDialect .INSTANCE .getSequenceSupport ().supportsPooledSequences ()).isTrue ();
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments