Example usage for com.mongodb DBCursor next

List of usage examples for com.mongodb DBCursor next

Introduction

In this page you can find the example usage for com.mongodb DBCursor next.

Prototype

@Override
public DBObject next() 

Source Link

Document

Returns the object the cursor is at and moves the cursor ahead by one.

Usage

From source file:achmad.rifai.erp1.entity.Beban.java

public static Beban of(DB d, String kode) throws Exception {
    Beban b = null;/*from  ww w .  j a v  a2 s .co m*/
    com.mongodb.DBObject w = new com.mongodb.BasicDBObject();
    w.put("berkas", kode);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getCollectionFromString("beban").find(w);
    if (c.hasNext()) {
        com.mongodb.DBObject o = c.next();
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) o.get("bin");
        String json = "";
        for (int x = 0; x < l.size(); x++)
            json += r.decrypt("" + l.get(x));
        b = new Beban(json);
    }
    return b;
}

From source file:achmad.rifai.erp1.entity.BukuAbsen.java

public static BukuAbsen of(Db d, String tgl) throws Exception {
    BukuAbsen v = null;//w  ww.java  2  s.co  m
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBObject p = new com.mongodb.BasicDBObject();
    p.put("berkas", tgl);
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("bukuabsen").find(p);
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < l.size(); x++)
            json += r.decrypt("" + l.get(x));
        v = new BukuAbsen(json);
        break;
    }
    return v;
}

From source file:achmad.rifai.erp1.entity.BulanBonus.java

public static BulanBonus of(String kode, Db d) throws Exception {
    BulanBonus b = null;//from   ww w  .  j  ava2  s .  c  o  m
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBObject p = new com.mongodb.BasicDBObject();
    p.put("berkas", kode);
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("bulanbonus").find(p);
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < l.size(); x++)
            json += r.decrypt("" + l.get(x));
        b = new BulanBonus(json);
        break;
    }
    return b;
}

From source file:achmad.rifai.erp1.entity.dao.DAOBarang.java

@Override
public List<Barang> all() throws Exception {
    List<Barang> l = new java.util.LinkedList<>();
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("barang").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        Barang b = new Barang(json);
        if (!b.isDeleted())
            l.add(b);/*from   www  .  ja  va 2  s . c om*/
    }
    return l;
}

From source file:achmad.rifai.erp1.entity.dao.DAOBukuAbsen.java

@Override
public List<BukuAbsen> all() throws Exception {
    List<BukuAbsen> l = new java.util.LinkedList<>();
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("bukuabsen").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        BukuAbsen b = new BukuAbsen(json);
        if (!b.isDeleted())
            l.add(b);//from   w w w. j a  va2s . c o  m
    }
    l.sort(sorter());
    return l;
}

From source file:achmad.rifai.erp1.entity.dao.DAOBulanBonus.java

@Override
public List<BulanBonus> all() throws Exception {
    List<BulanBonus> l = new java.util.LinkedList<>();
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("bulanbonus").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        BulanBonus b = new BulanBonus(json);
        if (!b.isDeleted())
            l.add(b);//from w w w  .  jav a  2  s  . c o m
    }
    l.sort(sorter());
    return l;
}

From source file:achmad.rifai.erp1.entity.dao.DAOJabatan.java

@Override
public List<Jabatan> all() throws Exception {
    List<Jabatan> l = new java.util.LinkedList<>();
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("jabatan").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        Jabatan j = new Jabatan(json);
        if (!j.isDeleted())
            l.add(j);//from   www.  ja  v  a2s. co m
    }
    return l;
}

From source file:achmad.rifai.erp1.entity.dao.DAOJurnal.java

@Override
public List<Jurnal> all() throws Exception {
    List<Jurnal> l = new java.util.LinkedList<>();
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("jurnal").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        Jurnal j = new Jurnal(json);
        if (!j.isDeleted())
            l.add(j);/*  www. j a  va2  s.  c  o  m*/
    }
    l.sort(sorter());
    return l;
}

From source file:achmad.rifai.erp1.entity.dao.DAOKaryawan.java

@Override
public List<Karyawan> all() throws Exception {
    List<Karyawan> l = new java.util.LinkedList<>();
    RSA r = Work.loadRSA();//w  w w . j  a  va 2 s  .c o  m
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("karyawan").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        Karyawan k = new Karyawan(json);
        if (!k.isDeleted())
            l.add(k);
    }
    l.sort(sorter());
    return l;
}

From source file:achmad.rifai.erp1.entity.dao.DAOKeluar.java

@Override
public List<Keluar> all() throws Exception {
    List<Keluar> l = new java.util.LinkedList<>();
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("keluar").find();
    while (c.hasNext()) {
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) c.next().get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        Keluar k = new Keluar(json);
        if (!k.isDeleted())
            l.add(k);/*from  w  ww  .j  a  v  a2 s.com*/
    }
    l.sort(sortir());
    return l;
}