Example usage for com.mongodb DBObject put

List of usage examples for com.mongodb DBObject put

Introduction

In this page you can find the example usage for com.mongodb DBObject put.

Prototype

Object put(String key, Object v);

Source Link

Document

Sets a name/value pair in this object.

Usage

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

public static Jurnal of(Db d, String kode) throws Exception {
    Jurnal v = null;/*w  w  w .ja va  2s. 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 w w  .  j a  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", 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 va 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;/*w  w  w . j ava2s  . 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("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;//from  w  w w. j a  va  2s  . 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("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;/*ww  w .ja 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("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;/* w w  w .  jav a  2s. 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", 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 v 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", 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;// ww w. j a  v  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", 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;
}

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

public static Suplier of(Db d, String kode) throws Exception {
    Suplier v = null;/*from ww 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("suplier").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 Suplier(json);
        break;
    }
    return v;
}