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 loadTugas(Db d) throws Exception {
    javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel(
            new String[] { "KODE", "URUTAN", "TANGGAL", "Keterangan", "Dibatalkan", "Ditunda" }, 0) {
        private Class[] c = new Class[] { String.class, String.class, java.sql.Date.class, String.class,
                Boolean.class, Boolean.class };

        @Override/*from w  w w. j  a  va 2  s.c o  m*/
        public Class<?> getColumnClass(int x) {
            return c[x];
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    tblTugas.setModel(m);
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("tugas").find();
    while (c.hasNext()) {
        com.mongodb.DBObject o = c.next();
        com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin");
        String json = "";
        for (int x = 0; x < li.size(); x++)
            json += r.decrypt("" + li.get(x));
        achmad.rifai.erp1.entity.Tugas t = new achmad.rifai.erp1.entity.Tugas(json);
        if (t.isDeleted())
            m.addRow(new Object[] { t.getKode(), t.getNo(), t.getTgl(), t.getKet(), t.isBatal(),
                    t.isPending() });
    }
}

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

private void hpsAbsen(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("absen").find();
    achmad.rifai.erp1.entity.dao.DAOBukuAbsen dao = new achmad.rifai.erp1.entity.dao.DAOBukuAbsen(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.BukuAbsen b = new achmad.rifai.erp1.entity.BukuAbsen(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*from  www. j a va 2  s.c  om*/
    }
}

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

private void hpsBarang(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("barang").find();
    achmad.rifai.erp1.entity.dao.DAOBarang dao = new achmad.rifai.erp1.entity.dao.DAOBarang(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.Barang b = new achmad.rifai.erp1.entity.Barang(s);
        if (b.isDeleted())
            dao.trueDelete(b);//from   w  w  w  . jav  a 2s . c o m
    }
}

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

private void hpsAset(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("rekening").find();
    achmad.rifai.erp1.entity.dao.DAORekening dao = new achmad.rifai.erp1.entity.dao.DAORekening(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.Rekening b = new achmad.rifai.erp1.entity.Rekening(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*from   w  w  w.ja  v a2s.  c  o  m*/
    }
}

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

private void hpsBonus(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("bulanbonus").find();
    achmad.rifai.erp1.entity.dao.DAOBulanBonus dao = new achmad.rifai.erp1.entity.dao.DAOBulanBonus(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.BulanBonus b = new achmad.rifai.erp1.entity.BulanBonus(s);
        if (b.isDeleted())
            dao.trueDelete(b);/*  ww w. ja  v  a  2  s.com*/
    }
}

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

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

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

private void hpsJurnal(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("jurnal").find();
    achmad.rifai.erp1.entity.dao.DAOJurnal dao = new achmad.rifai.erp1.entity.dao.DAOJurnal(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.Jurnal b = new achmad.rifai.erp1.entity.Jurnal(s);
        if (b.isDeleted())
            dao.trueDelete(b);//from  w ww . j ava  2  s  .  c  o  m
    }
}

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

private void hpsIncome(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("terima").find();
    achmad.rifai.erp1.entity.dao.DAOTerima dao = new achmad.rifai.erp1.entity.dao.DAOTerima(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.Terima b = new achmad.rifai.erp1.entity.Terima(s);
        if (b.isDeleted())
            dao.trueDelete(b);//w w  w . jav a2 s  . c  o m
    }
}

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

private void hpsKaryawan(Db d) throws Exception {
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("karyawan").find();
    achmad.rifai.erp1.entity.dao.DAOKaryawan dao = new achmad.rifai.erp1.entity.dao.DAOKaryawan(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.Karyawan b = new achmad.rifai.erp1.entity.Karyawan(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 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 av a  2  s .c  o m*/
    }
}