perf(document): add @BatchSize(50) to sender and trainingLabels
Consistent with the @BatchSize already on receivers and tags. Any lazy code path not covered by an entity graph will batch-load these associations instead of issuing one query per document. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -136,6 +136,7 @@ public class Document {
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "sender_id")
|
||||
@BatchSize(size = 50)
|
||||
private Person sender;
|
||||
|
||||
@ManyToMany(fetch = FetchType.LAZY)
|
||||
@@ -148,6 +149,7 @@ public class Document {
|
||||
@CollectionTable(name = "document_training_labels", joinColumns = @JoinColumn(name = "document_id"))
|
||||
@Column(name = "label")
|
||||
@Enumerated(EnumType.STRING)
|
||||
@BatchSize(size = 50)
|
||||
@Builder.Default
|
||||
private Set<TrainingLabel> trainingLabels = new HashSet<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user