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.admin.ui.Sampah.java

private void hpsExpenses(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("keluar").find();
    achmad.rifai.erp1.entity.dao.DAOKeluar dao = new achmad.rifai.erp1.entity.dao.DAOKeluar(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.Keluar b = new achmad.rifai.erp1.entity.Keluar(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*from w w w .j a va  2s. co  m*/
    }
}

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 ww w . j  a va  2s. c  o 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 av  a  2  s.c o  m
    }
}

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);//  w  w w  . j  ava  2s .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);//w w w  . j av  a 2  s  .co m
    }
}

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);/*from   ww w  . j a  va2 s  .co  m*/
    }
}

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);//  w w  w  . jav a  2s. c om
    }
}

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);/*ww w.  j  a  v  a 2  s . c o  m*/
    }
}

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);/* w  w  w.  j  a va  2  s.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;//  ww w. j  a  v a  2  s.  com
    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;
}