diff --git a/generators/spring-data-relational/generator.mts b/generators/spring-data-relational/generator.mts index 5210de3ac28a..bb0485083aef 100644 --- a/generators/spring-data-relational/generator.mts +++ b/generators/spring-data-relational/generator.mts @@ -86,6 +86,23 @@ export default class SqlGenerator extends BaseApplicationGenerator this.preparing); } + get preparingEachEntity() { + return this.asPreparingEachEntityTaskGroup({ + prepareEntity({ entity }) { + entity.relationships.forEach(relationship => { + if (relationship.persistableRelationship === undefined) { + // This is a v8.1 behavior, make it default if blueprints adopts it. + relationship.persistableRelationship = relationship.ownerSide || relationship.relationshipManyToMany; + } + }); + }, + }); + } + + get [BaseApplicationGenerator.PREPARING_EACH_ENTITY]() { + return this.delegateTasksToBlueprint(() => this.preparingEachEntity); + } + get preparingEachEntityRelationship() { return this.asPreparingEachEntityRelationshipTaskGroup({ prepareRelationship({ application, relationship }) {