io.ebeaninternal.server.deploy.BeanMapQueryHelp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.deploy;
import io.ebean.bean.BeanCollection;
import io.ebean.bean.EntityBean;
import io.ebean.common.BeanMap;
import io.ebeaninternal.server.el.ElPropertyValue;
import io.ebeaninternal.server.query.CQueryCollectionAdd;
class BeanMapQueryHelp implements CQueryCollectionAdd {
private final ElPropertyValue elGetValue;
/**
* Create for a findMap query.
*/
BeanMapQueryHelp(ElPropertyValue elGetValue) {
this.elGetValue = elGetValue;
}
@Override
public BeanCollection createEmptyNoParent() {
return new BeanMap<>();
}
@Override
public void add(BeanCollection collection, EntityBean bean, boolean withCheck) {
if (bean == null) {
((BeanMap, ?>) collection).internalPutNull();
} else {
Object keyValue = elGetValue.pathGet(bean);
BeanMap, ?> map = ((BeanMap, ?>) collection);
map.internalPutWithCheck(keyValue, bean);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy