-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Labels
type: enhancementNew feature or requestNew feature or request
Description
Issue description
The idea is to extend support for JSON Duality View with similar features that exist for other entities.
An example of extended class could be:
AuthorView.java
@JsonView(
value = "AUTHOR_BOOKS", // the name of the duality view
entity = Author.class, // The base entity
with = { UPDATE, INSERT, DELETE } // The operations of the view specified in SQL CREATE query
)public record AuthorView(
@Id @GeneratedValue(GeneratedValue.Type.IDENTITY) @Nullable
Long authorId,
@MappedProperty("name") //author.name will be used to fill this property
String author,
@Relation(Relation.Kind.ONE_TO_MANY)
List<AuthorBookView> books
) {}
@JsonSubView(
entity = Book.class // The base entity
)
record AuthorBookView(
String name
) {}This would require modifications to the current @JsonView annotation.
Since micronaut-data already supports operations on an existing JSON duality view, improvement would be to create duality views automatically using the SchemaGenerator micronaut feature. See detailed pointers below
@ZdravDimOracle is working on this
Metadata
Metadata
Assignees
Labels
type: enhancementNew feature or requestNew feature or request