mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#879 - Ebean not fetching complete list of attribute beans when equals(Object o) is implemented
This commit is contained in:
@@ -85,11 +85,23 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
|
||||
@Override
|
||||
public void internalAddWithCheck(Object bean) {
|
||||
if (list == null || !list.contains(bean)) {
|
||||
if (list == null || !containsInstance(bean)) {
|
||||
internalAdd(bean);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains using instance equality for List (specifically not .equals() based).
|
||||
*/
|
||||
private boolean containsInstance(Object bean) {
|
||||
for (Object element : list) {
|
||||
if (element == bean) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkEmptyLazyLoad() {
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user