Example usage for com.mongodb DBCursor hasNext

List of usage examples for com.mongodb DBCursor hasNext

Introduction

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

Prototype

@Override
public boolean hasNext() 

Source Link

Document

Checks if there is another object available.

Usage

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsLedger(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("ledger").find();
    achmad.rifai.erp1.entity.dao.DAOLedger dao = new achmad.rifai.erp1.entity.dao.DAOLedger(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Ledger b = new achmad.rifai.erp1.entity.Ledger(s);
        if (b.isDeleted())
            dao.trueDelete(b);//from w ww  .j av  a  2  s .co  m
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsPelanggan(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("pelanggan").find();
    achmad.rifai.erp1.entity.dao.DAOPelanggan dao = new achmad.rifai.erp1.entity.dao.DAOPelanggan(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Pelanggan b = new achmad.rifai.erp1.entity.Pelanggan(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*from w w w .  j  a  v a  2  s  .  com*/
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsPembelian(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("pembelian").find();
    achmad.rifai.erp1.entity.dao.DAOPembelian dao = new achmad.rifai.erp1.entity.dao.DAOPembelian(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Pembelian b = new achmad.rifai.erp1.entity.Pembelian(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*from   w w  w .  j  ava  2  s .  co m*/
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsPenjualan(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("penjualan").find();
    achmad.rifai.erp1.entity.dao.DAOPenjualan dao = new achmad.rifai.erp1.entity.dao.DAOPenjualan(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Penjualan b = new achmad.rifai.erp1.entity.Penjualan(s);
        if (b.isDeleted())
            dao.trueDelete(b);//from   ww w.ja v  a  2  s  .c om
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsPesan(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("pesan").find();
    achmad.rifai.erp1.entity.dao.DAOPesan dao = new achmad.rifai.erp1.entity.dao.DAOPesan(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Pesan b = new achmad.rifai.erp1.entity.Pesan(s);
        if (b.isDeleted())
            dao.trueDelete(b);/* w  ww.  j ava 2 s . c om*/
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsSuplier(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("suplier").find();
    achmad.rifai.erp1.entity.dao.DAOSuplier dao = new achmad.rifai.erp1.entity.dao.DAOSuplier(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Suplier b = new achmad.rifai.erp1.entity.Suplier(s);
        if (b.isDeleted())
            dao.trueDelete(b);//from w  w  w.j a v a2 s.  com
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsPerilaku(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("tracks").find();
    achmad.rifai.erp1.entity.dao.DAOTracks dao = new achmad.rifai.erp1.entity.dao.DAOTracks(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Tracks b = new achmad.rifai.erp1.entity.Tracks(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*from ww  w . ja v  a 2 s  .  com*/
    }
}

From source file:achmad.rifai.admin.ui.Sampah.java

private void hpsTugas(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("tugas").find();
    achmad.rifai.erp1.entity.dao.DAOTugas dao = new achmad.rifai.erp1.entity.dao.DAOTugas(d);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    while (c.hasNext()) {
        com.mongodb.BasicDBList l = (com.mongodb.BasicDBList) c.next().get("bin");
        String s = "";
        for (int x = 0; x < l.size(); x++)
            s += r.decrypt("" + l.get(x));
        achmad.rifai.erp1.entity.Tugas b = new achmad.rifai.erp1.entity.Tugas(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*from   w  ww .  ja va  2s.c o  m*/
    }
}

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

public static Barang of(Db d, String kode) throws Exception {
    Barang v = null;//  w  w w. j a  v a2s.  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("barang").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 Barang(json);
        break;
    }
    return v;
}

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

public static Beban of(DB d, String kode) throws Exception {
    Beban b = null;/*from w w  w  . ja  v  a 2s . c o  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;
}