@MappedCollection => allow to configure table name? #1603
Labels
status: pending-design-work
Needs design work before any code can be developed
type: enhancement
A general enhancement
First of all, thanks again for this great project/product!
I have a suggestion to be able to reuse classes when using
@MappedCollection
. Currently, when using@MappedCollection
for referencing sub-entities, a table name cannot be specified.This results in classes that can not be reused as the table name needs to specified on the sub-entity. Due to the volume/amount of rows, I would like to have each
@MappedCollection
sub-entity in a separate table, per entity.Problem description
Imagine the following
Link
class that I would like to reuse in different Spring Data JDBC Entities.The only way to embed this in multiple entities is by creating subclasses:
This way, it can be used using a
@MappedCollection
in theTask
entity.For another entity, the same approach is needed.
Proposed solution
Instead of the subclass, I would like to suggest the following approach, which would remove the need for the subclassing:
Extra context
I also tried with a custom
NamingStrategy
but I do not have enough context when thegetTableName
is called as it does not provide any information whether this is called from a MappedCollection and if so, from which entity.The text was updated successfully, but these errors were encountered: