Example usage for com.mongodb BasicDBList get

List of usage examples for com.mongodb BasicDBList get

Introduction

In this page you can find the example usage for com.mongodb BasicDBList get.

Prototype

public Object get(final String key) 

Source Link

Document

Gets a value at an index.

Usage

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. j a  v  a  2s.c om
    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;
}

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

public static BukuAbsen of(Db d, String tgl) throws Exception {
    BukuAbsen v = null;/* w  w  w .j av a  2 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", 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;/*from w  w w  .  j a v  a2 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("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);// ww  w.  j  a  va 2 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);/*  ww w  .j a va2  s .  c om*/
    }
    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 ww  w .  j a  v a  2  s  . com*/
    }
    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  w  w .  j  a v  a2 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);/*  w  ww  . j  a  v a 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 .jav a 2  s .c  om
    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  www  .ja  v a 2  s . c om
    }
    l.sort(sortir());
    return l;
}