Skip to content

Commit 9b87a27

Browse files
committed
Intermediate change
1 parent dcdfda0 commit 9b87a27

79 files changed

Lines changed: 5744 additions & 554 deletions

File tree

Some content is hidden

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

all/pom.xml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -367,24 +367,12 @@
367367
<artifactId>helidon-data-codegen-query</artifactId>
368368
</dependency>
369369
<dependency>
370-
<groupId>io.helidon.data.declarative</groupId>
371-
<artifactId>helidon-data-declarative</artifactId>
372-
</dependency>
373-
<dependency>
374-
<groupId>io.helidon.data.declarative.codegen</groupId>
375-
<artifactId>helidon-data-declarative-codegen</artifactId>
376-
</dependency>
377-
<dependency>
378-
<groupId>io.helidon.data.declarative.codegen</groupId>
379-
<artifactId>helidon-data-declarative-codegen-jdbc</artifactId>
380-
</dependency>
381-
<dependency>
382-
<groupId>io.helidon.data.declarative</groupId>
383-
<artifactId>helidon-data-declarative-jdbc</artifactId>
370+
<groupId>io.helidon.data.jdbc</groupId>
371+
<artifactId>helidon-data-jdbc</artifactId>
384372
</dependency>
385373
<dependency>
386374
<groupId>io.helidon.data.jdbc</groupId>
387-
<artifactId>helidon-data-jdbc</artifactId>
375+
<artifactId>helidon-data-jdbc-codegen</artifactId>
388376
</dependency>
389377
<dependency>
390378
<groupId>io.helidon.data.jdbc</groupId>

bom/pom.xml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -516,28 +516,13 @@
516516
<version>${helidon.version}</version>
517517
</dependency>
518518
<dependency>
519-
<groupId>io.helidon.data.declarative</groupId>
520-
<artifactId>helidon-data-declarative</artifactId>
521-
<version>${helidon.version}</version>
522-
</dependency>
523-
<dependency>
524-
<groupId>io.helidon.data.declarative.codegen</groupId>
525-
<artifactId>helidon-data-declarative-codegen</artifactId>
526-
<version>${helidon.version}</version>
527-
</dependency>
528-
<dependency>
529-
<groupId>io.helidon.data.declarative.codegen</groupId>
530-
<artifactId>helidon-data-declarative-codegen-jdbc</artifactId>
531-
<version>${helidon.version}</version>
532-
</dependency>
533-
<dependency>
534-
<groupId>io.helidon.data.declarative</groupId>
535-
<artifactId>helidon-data-declarative-jdbc</artifactId>
519+
<groupId>io.helidon.data.jdbc</groupId>
520+
<artifactId>helidon-data-jdbc</artifactId>
536521
<version>${helidon.version}</version>
537522
</dependency>
538523
<dependency>
539524
<groupId>io.helidon.data.jdbc</groupId>
540-
<artifactId>helidon-data-jdbc</artifactId>
525+
<artifactId>helidon-data-jdbc-codegen</artifactId>
541526
<version>${helidon.version}</version>
542527
</dependency>
543528
<dependency>

data/data/src/main/java/io/helidon/data/Data.java

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package io.helidon.data;
1717

1818
import java.lang.annotation.ElementType;
19+
import java.lang.annotation.Repeatable;
1920
import java.lang.annotation.Retention;
2021
import java.lang.annotation.RetentionPolicy;
2122
import java.lang.annotation.Target;
@@ -134,6 +135,175 @@ private Data() {
134135
String value();
135136
}
136137

138+
/**
139+
* Result mapping from a provider result field to a model property.
140+
* <p>
141+
* This annotation is intended for compile-time repository processing. Providers may use it to generate mapper code
142+
* without relying on runtime reflection or implicit column/property naming.
143+
*/
144+
@Target({ElementType.TYPE, ElementType.METHOD})
145+
@Retention(RetentionPolicy.SOURCE)
146+
@Repeatable(Maps.class)
147+
public @interface Map {
148+
/**
149+
* Source result field, such as a SQL column label.
150+
* <p>
151+
* This is an alias for {@link #source()}.
152+
*
153+
* @return source result field
154+
*/
155+
String value() default "";
156+
157+
/**
158+
* Source result field, such as a SQL column label.
159+
* <p>
160+
* This is an alias for {@link #value()}.
161+
*
162+
* @return source result field
163+
*/
164+
String source() default "";
165+
166+
/**
167+
* Target model property.
168+
*
169+
* @return target model property
170+
*/
171+
String target();
172+
}
173+
174+
/**
175+
* Container annotation for repeatable {@link Data.Map} declarations.
176+
*/
177+
@Target({ElementType.TYPE, ElementType.METHOD})
178+
@Retention(RetentionPolicy.SOURCE)
179+
public @interface Maps {
180+
/**
181+
* Mapping declarations.
182+
*
183+
* @return mapping declarations
184+
*/
185+
Map[] value();
186+
}
187+
188+
/**
189+
* Result aggregation key.
190+
* <p>
191+
* Providers may use this annotation when generating relationship reducers for joined result sets. When omitted,
192+
* providers may use their documented key conventions, such as {@code id} for the root object and
193+
* {@code relation.id} for collection elements.
194+
*/
195+
@Target({ElementType.TYPE, ElementType.METHOD})
196+
@Retention(RetentionPolicy.SOURCE)
197+
@Repeatable(Keys.class)
198+
public @interface Key {
199+
/**
200+
* Source result fields that make up the key.
201+
* <p>
202+
* This is an alias for {@link #source()}.
203+
*
204+
* @return source result fields
205+
*/
206+
String[] value() default {};
207+
208+
/**
209+
* Source result fields that make up the key.
210+
* <p>
211+
* This is an alias for {@link #value()}.
212+
*
213+
* @return source result fields
214+
*/
215+
String[] source() default {};
216+
217+
/**
218+
* Target aggregate path. An empty value identifies the root aggregate.
219+
*
220+
* @return target aggregate path
221+
*/
222+
String target() default "";
223+
}
224+
225+
/**
226+
* Container annotation for repeatable {@link Data.Key} declarations.
227+
*/
228+
@Target({ElementType.TYPE, ElementType.METHOD})
229+
@Retention(RetentionPolicy.SOURCE)
230+
public @interface Keys {
231+
/**
232+
* Key declarations.
233+
*
234+
* @return key declarations
235+
*/
236+
Key[] value();
237+
}
238+
239+
/**
240+
* Declarative result mapper contract.
241+
* <p>
242+
* Providers may generate mapper implementations from this annotation and companion {@link Data.Map} declarations.
243+
* The annotated type describes mapping metadata only; applications are not expected to implement JDBC row-reading logic.
244+
*/
245+
@Target(ElementType.TYPE)
246+
@Retention(RetentionPolicy.SOURCE)
247+
public @interface Mapper {
248+
/**
249+
* Target model type created by the generated mapper.
250+
*
251+
* @return target model type
252+
*/
253+
Class<?> target();
254+
}
255+
256+
/**
257+
* Selects a result mapper for a repository method.
258+
* <p>
259+
* The selected type may be a declarative {@link Data.Mapper} contract whose implementation is generated at build time.
260+
* Providers may also use this annotation later for explicit mapper service extension points.
261+
*/
262+
@Target(ElementType.METHOD)
263+
@Retention(RetentionPolicy.SOURCE)
264+
public @interface MapWith {
265+
/**
266+
* Mapper contract or mapper service type.
267+
*
268+
* @return mapper type
269+
*/
270+
Class<?> value();
271+
}
272+
273+
/**
274+
* Selects a result reducer for a repository method.
275+
* <p>
276+
* The selected type may be a declarative {@link Data.Mapper} contract whose reducer implementation is generated at
277+
* build time. Providers may also use this annotation later for explicit reducer service extension points.
278+
*/
279+
@Target(ElementType.METHOD)
280+
@Retention(RetentionPolicy.SOURCE)
281+
public @interface ReduceWith {
282+
/**
283+
* Reducer contract or reducer service type.
284+
*
285+
* @return reducer type
286+
*/
287+
Class<?> value();
288+
}
289+
290+
/**
291+
* Generated keys requested by a repository method.
292+
* <p>
293+
* This annotation is provider-neutral. JDBC providers may translate the supplied column names to
294+
* {@link java.sql.Connection#prepareStatement(String, String[])} generated-key handling.
295+
*/
296+
@Target(ElementType.METHOD)
297+
@Retention(RetentionPolicy.SOURCE)
298+
public @interface GeneratedKeys {
299+
/**
300+
* Generated-key column names. When empty, the provider default generated-key behavior is used.
301+
*
302+
* @return generated-key column names
303+
*/
304+
String[] value() default {};
305+
}
306+
137307
/**
138308
* Data repository interface for basic entity operations.
139309
*

data/declarative/codegen/codegen/pom.xml

Lines changed: 0 additions & 70 deletions
This file was deleted.

data/declarative/codegen/codegen/src/main/java/io/helidon/data/declarative/codegen/DataDeclarativeCodegenExtensionProvider.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

data/declarative/codegen/codegen/src/main/java/io/helidon/data/declarative/codegen/package-info.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)