List of usage examples for com.mongodb DBObject put
Object put(String key, Object v);
From source file:achmad.rifai.erp1.entity.Barang.java
public static Barang of(Db d, String kode) throws Exception { Barang v = null;/*w w w. j ava2 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("barang").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 Barang(json); break; } return v; }
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. ja v a 2 s. c o m*/ 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;//from w w w .ja 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", 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 www.j av a2s .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("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 void update(Barang a, Barang b) throws Exception { achmad.rifai.erp1.beans.Form1 f = new achmad.rifai.erp1.beans.Form1(b.getKode(), b); com.mongodb.DBObject w = new com.mongodb.BasicDBObject(); w.put("berkas", a.getKode()); d.getD().getCollectionFromString("barang").update(w, f.genComparasion()); }
From source file:achmad.rifai.erp1.entity.dao.DAOBarang.java
public void trueDelete(Barang v) throws Exception { com.mongodb.DBObject o = new com.mongodb.BasicDBObject(); o.put("berkas", v.getKode()); d.getD().getCollectionFromString("barang").remove(o); }
From source file:achmad.rifai.erp1.entity.dao.DAOBeban.java
@Override public void update(Beban a, Beban b) throws Exception { com.mongodb.DBObject w = new com.mongodb.BasicDBObject(); w.put("berkas", a.getKode()); achmad.rifai.erp1.beans.Form1 f = new achmad.rifai.erp1.beans.Form1(a.getKode(), b); d.getCollectionFromString("beban").update(w, f.genComparasion()); }
From source file:achmad.rifai.erp1.entity.dao.DAOBukuAbsen.java
@Override public void update(BukuAbsen a, BukuAbsen b) throws Exception { achmad.rifai.erp1.beans.Form1 f = new achmad.rifai.erp1.beans.Form1(b.getTgl(), b); com.mongodb.DBObject w = new com.mongodb.BasicDBObject(); w.put("berkas", a.getTgl()); d.getD().getCollectionFromString("bukuabsen").update(w, f.genComparasion()); }
From source file:achmad.rifai.erp1.entity.dao.DAOBukuAbsen.java
public void trueDelete(BukuAbsen a) { com.mongodb.DBObject o = new com.mongodb.BasicDBObject(); o.put("berkas", a.getTgl()); d.getD().getCollectionFromString("bukuabsen").remove(o); }
From source file:achmad.rifai.erp1.entity.dao.DAOBulanBonus.java
@Override public void update(BulanBonus a, BulanBonus b) throws Exception { achmad.rifai.erp1.beans.Form1 f = new achmad.rifai.erp1.beans.Form1(b.getKode(), b); com.mongodb.DBObject w = new com.mongodb.BasicDBObject(); w.put("berkas", a.getKode()); d.getD().getCollectionFromString("bulanbonus").update(w, f.genComparasion()); }