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.erp1.entity.BukuAbsen.java

public static BukuAbsen of(Db d, String tgl) throws Exception {
    BukuAbsen v = null;//from ww w. j a va 2  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", 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;/*w ww  .  j  av  a  2s .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.j  a  v  a2 s.  co  m
    }
    return l;
}

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

@Override
public List<Beban> all() throws Exception {
    List<Beban> l = new java.util.LinkedList<>();
    com.mongodb.DBCursor c = d.getCollectionFromString("beban").find();
    while (c.hasNext()) {

    }//  w  ww.j  ava2 s  .  co m
    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);/*w ww . j  av  a2s. co  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 ww .  j  ava 2s . c  om
    }
    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 w ww .  j a va2  s . c o  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);//from  ww w  .  java 2  s.co 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();//from   w w  w.  j a v a  2s .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  w  w  . j ava 2s .c  o m*/
    }
    l.sort(sortir());
    return l;
}