org.nutz.mongo.adaptor.ZMoCollectionAdaptor Maven / Gradle / Ivy
package org.nutz.mongo.adaptor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.bson.types.ObjectId;
import org.nutz.lang.Lang;
import org.nutz.lang.Mirror;
import org.nutz.mongo.ZMo;
import org.nutz.mongo.ZMoAdaptor;
import org.nutz.mongo.entity.ZMoEntity;
import org.nutz.mongo.entity.ZMoField;
import com.mongodb.BasicDBList;
import com.mongodb.DBObject;
public class ZMoCollectionAdaptor implements ZMoAdaptor {
ZMoCollectionAdaptor() {}
@SuppressWarnings("unchecked")
@Override
public Object toJava(ZMoField fld, Object obj) {
if (obj instanceof BasicDBList) {
BasicDBList list = (BasicDBList) obj;
// 获取元素的实体
ZMoEntity en = null;
// 创建数组
Collection
© 2015 - 2024 Weber Informatics LLC | Privacy Policy