diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java b/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java index 156aa5f..2d6f82b 100644 --- a/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java +++ b/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java @@ -3,6 +3,7 @@ package com.loremind.infrastructure.persistence.entity; import com.loremind.domain.campaigncontext.ArcType; import com.loremind.infrastructure.persistence.converter.StringListJsonConverter; import jakarta.persistence.*; +import org.hibernate.annotations.ColumnDefault; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -42,8 +43,12 @@ public class ArcJpaEntity { * Type structurel de l'arc (LINEAR par défaut). * Stocké en STRING pour rester lisible en DB et résistant aux refactos d'ordre. */ + // length + @ColumnDefault (PAS columnDefinition brut) : Hibernate 6.6 recopie + // columnDefinition tel quel dans son ALTER ... SET DATA TYPE de migration, et + // PostgreSQL refuse DEFAULT à cet endroit (erreur à chaque démarrage). @Enumerated(EnumType.STRING) - @Column(nullable = false, columnDefinition = "VARCHAR(16) DEFAULT 'LINEAR'") + @Column(nullable = false, length = 16) + @ColumnDefault("'LINEAR'") @Builder.Default private ArcType type = ArcType.LINEAR; diff --git a/core/src/main/java/com/loremind/infrastructure/storage/MinioConfig.java b/core/src/main/java/com/loremind/infrastructure/storage/MinioConfig.java index 66a3850..425a4d8 100644 --- a/core/src/main/java/com/loremind/infrastructure/storage/MinioConfig.java +++ b/core/src/main/java/com/loremind/infrastructure/storage/MinioConfig.java @@ -32,6 +32,11 @@ public class MinioConfig { @Bean public MinioClient minioClient() { + return buildClient(); + } + + /** Fabrique directe (sans proxy Spring) — voir ensureBucketExists. */ + private MinioClient buildClient() { return MinioClient.builder() .endpoint(endpoint) .credentials(accessKey, secretKey) @@ -42,11 +47,16 @@ public class MinioConfig { * Garantit l'existence du bucket au demarrage. Si MinIO n'est pas joignable, * on loggue juste l'erreur sans planter l'application : le developpeur * recevra une erreur claire au premier upload plutot qu'au boot. + *
+ * NB : on construit un client LOCAL au lieu d'appeler {@code minioClient()} — + * depuis Spring 6.2, appeler une methode @Bean proxifiee pendant le + * @PostConstruct de sa propre @Configuration leve "Requested bean is + * currently in creation" et la verification ne tournait plus jamais. */ @PostConstruct public void ensureBucketExists() { try { - MinioClient client = minioClient(); + MinioClient client = buildClient(); boolean exists = client.bucketExists(BucketExistsArgs.builder().bucket(bucket).build()); if (!exists) { client.makeBucket(MakeBucketArgs.builder().bucket(bucket).build());