Examples of IMongoBean


Examples of org.xtext.mongobeans.lib.IMongoBean

*/
@SuppressWarnings("all")
public class WrappingUtil {
  public static IMongoBean wrap(final DBObject dbObject) {
    try {
      IMongoBean _xblockexpression = null;
      {
        Object _get = dbObject.get(IMongoBean.JAVA_CLASS_KEY);
        String _string = null;
        if (_get!=null) {
          _string=_get.toString();
        }
        final String javaClassName = _string;
        ClassLoader _classLoader = WrappingUtil.getClassLoader();
        final Class<?> javaClass = _classLoader.loadClass(javaClassName);
        IMongoBean _xifexpression = null;
        boolean _isAssignableFrom = IMongoBean.class.isAssignableFrom(javaClass);
        if (_isAssignableFrom) {
          IMongoBean _xblockexpression_1 = null;
          {
            final Constructor<?> constructor = javaClass.getConstructor(DBObject.class);
            Object _newInstance = constructor.newInstance(dbObject);
            _xblockexpression_1 = ((IMongoBean) _newInstance);
          }
View Full Code Here

Examples of org.xtext.mongobeans.lib.IMongoBean

      throw Exceptions.sneakyThrow(_e);
    }
  }
 
  public static <T extends IMongoBean> T wrapAndCast(final DBObject dbObject) {
    IMongoBean _wrap = WrappingUtil.wrap(dbObject);
    return ((T) _wrap);
  }
View Full Code Here

Examples of org.xtext.mongobeans.lib.IMongoBean

@SuppressWarnings("all")
public class MongoExtensions {
  public <T extends IMongoBean> T findOneBean(final DBCollection collection, final T wrapper) {
    DBObject _dbObject = wrapper.getDbObject();
    DBObject _findOne = collection.findOne(_dbObject);
    IMongoBean _wrap = null;
    if (_findOne!=null) {
      _wrap=WrappingUtil.wrap(_findOne);
    }
    return ((T) _wrap);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.