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.Jabatan.java

public static Jabatan of(Db d, String nama) throws Exception {
    Jabatan v = null;//from  www . ja v  a 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", nama);
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("jabatan").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 Jabatan(json);
        break;
    }
    return v;
}

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

public static Jurnal of(Db d, String kode) throws Exception {
    Jurnal v = null;/*from   ww w.  ja v a2 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", kode);
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("jurnal").find(p);
    if (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 Jurnal(json);
    }
    return v;
}

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

public static Karyawan of(Db d, String id) throws Exception {
    Karyawan v = null;//from   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", id);
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("karyawan").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 Karyawan(json);
        break;
    }
    return v;
}

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

public static Keluar of(Db d, String kode) throws Exception {
    Keluar v = null;/*from   w  w w .  j  a v  a  2  s. c  om*/
    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("keluar").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 Keluar(json);
        break;
    }
    return v;
}

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

public static Ledger of(Db d, String kode) throws Exception {
    Ledger v = null;/*from  w  w w.  j  av a2s.  c om*/
    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("ledger").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 Ledger(json);
        break;
    }
    return v;
}

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

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

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

public static Pembelian of(Db d, String struk, String suplier, Date tgl) throws Exception {
    Pembelian v = null;/*from  w  w  w.  j a v a2  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("berkas1", struk);
    p.put("berkas2", suplier);
    p.put("berkas3", "" + tgl);
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("pembelian").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 Pembelian(json);
        break;
    }
    return v;
}

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

public static Penjualan of(Db d, String nota) throws Exception {
    Penjualan v = null;/*from   ww  w.  j  a v  a 2 s.c  om*/
    achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA();
    com.mongodb.DBObject p = new com.mongodb.BasicDBObject();
    p.put("berkas", nota);
    com.mongodb.DBCursor c = d.getD().getCollectionFromString("penjualan").find(p);
    while (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));
        v = new Penjualan(json);
        break;
    }
    return v;
}

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

public static Pesan of(Db d, String kode) throws Exception {
    Pesan v = null;//from   w  w  w  .j  a va 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("pesan").find(p);
    while (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));
        v = new Pesan(json);
        break;
    }
    return v;
}

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

public static Rekening of(Db d, String kode) throws Exception {
    Rekening v = null;//from   w w w .jav  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("rekening").find(p);
    while (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));
        v = new Rekening(json);
        break;
    }
    return v;
}