com.avaje.ebeaninternal.server.deploy.BeanListHelp Maven / Gradle / Ivy
package com.avaje.ebeaninternal.server.deploy;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.InvalidValue;
import com.avaje.ebean.Query;
import com.avaje.ebean.Transaction;
import com.avaje.ebean.bean.BeanCollection;
import com.avaje.ebean.bean.BeanCollectionAdd;
import com.avaje.ebean.bean.BeanCollectionLoader;
import com.avaje.ebean.common.BeanList;
import com.avaje.ebeaninternal.server.text.json.WriteJsonContext;
/**
* Helper object for dealing with Lists.
*/
public final class BeanListHelp implements BeanCollectionHelp {
private final BeanPropertyAssocMany many;
private final BeanDescriptor targetDescriptor;
private BeanCollectionLoader loader;
public BeanListHelp(BeanPropertyAssocMany many){
this.many = many;
this.targetDescriptor = many.getTargetDescriptor();
}
public BeanListHelp(){
this.many = null;
this.targetDescriptor = null;
}
public void setLoader(BeanCollectionLoader loader){
this.loader = loader;
}
public void add(BeanCollection> collection, Object bean) {
collection.internalAdd(bean);
}
public BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
if (bc instanceof BeanList>){
BeanList> bl = (BeanList>)bc;
if (bl.getActualList() == null){
bl.setActualList(new ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy