-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Milestone
Description
Hi,
I'm not sure if it is related to #476, if yes then sorry for duplicate.
I am using JdbcMapper.stream to map one-to-many relation to my objects:
class A {
private Set<B> bs;
}
class B {
}
I am using builder pattern to instantiate objects of A and I'm copying the set in the constructor to guarantee that A is immutable:
private A(Set<B> bs) { this.bs = Collections.unmodifiableSet(new HashSet<>(bs)); }
In the result there is an A with only one object of B in the set whilst there should be more of them.
After some of debugging I found that the sequence of actions is as follows:
- new set of Bs is created and one object is inserted
- instance of A is instantiated using builder, the set with one element inside is used
- the set is copied in the A's constructor
- more objects of B are added to the set
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels