When loading an entity like the following:
@Entity
@BatchSize(size = 10)
public class MyEntity {
@ManyToOne(fetch = LAZY)
MyEntity assoc;
}
with e.g. a max_fetch_depth of 0, we will end up with batch fetching for the association assoc, but it will use a batch size of 10 even if the database supports arrays, though it should fetch all entries at once instead to avoid database ping-pong. Today we discussed one possible way to fix this, which is to create a dedicated entry for eager entities in the batch fetch queue. |