Problem
Spring Data Relational's @Embedded currently only supports a prefix attribute to group multiple columns belonging to an embedded type (class/record). This works well where a common prefix is the natural grouping mechanism given by the language. However, there are some cases where a common suffix is the natural way to group these columns, and where suffix attribute on @Embedded would make the mapping more intuitive.
Examples
first_name, last_name
home_phone, work_phone, mobile_phone
min_age, max_age, median_age, avg_age
Use case could look like this:
record Statistics(int min, int max, int median, int average) {}
@Embedded(suffix = "_age") Statistics ageStatistics
There might even be use cases where both prefix and suffix together form the natural way of grouping things together in the english language. Couldn't come up of concrete examples there though.
Problem
Spring Data Relational's
@Embeddedcurrently only supports aprefixattribute to group multiple columns belonging to an embedded type (class/record). This works well where a common prefix is the natural grouping mechanism given by the language. However, there are some cases where a common suffix is the natural way to group these columns, and wheresuffixattribute on@Embeddedwould make the mapping more intuitive.Examples
first_name,last_namehome_phone,work_phone,mobile_phonemin_age,max_age,median_age,avg_ageUse case could look like this:
There might even be use cases where both prefix and suffix together form the natural way of grouping things together in the english language. Couldn't come up of concrete examples there though.