collection « Batch « JPA Q&A

1. Lazy collection batch-size value and actual query

I have faced pretty doubtful Hibernate behaviour when initializing batches of lazy collections with preconfigured batch-size. Having the following mapping: Code: ... and reading a list of 135 Person from database I was expecting, that invoking Hibernate.initialize() on ...

3. lazy loading collection batch-size

Hi all; i have a problem with lazy load in batch of collections. I have the following mapping:

4. Batch reading of collection with lazy OneToOne relation

@OneToMany(mappedBy = "partner", cascade = { CascadeType.MERGE, CascadeType.PERSIST }, fetch = FetchType.LAZY) @BatchSize(size = 100) @IndexColumn(name = "id") @JoinColumn(name = "partner_id", referencedColumnName = "id") public Set getRoles() { return roles; ...