List of usage examples for com.mongodb DBObject get
Object get(String key);
From source file:achmad.rifai.admin.ui.Sampah.java
private void loadTugas(Db d) throws Exception { javax.swing.table.DefaultTableModel m = new javax.swing.table.DefaultTableModel( new String[] { "KODE", "URUTAN", "TANGGAL", "Keterangan", "Dibatalkan", "Ditunda" }, 0) { private Class[] c = new Class[] { String.class, String.class, java.sql.Date.class, String.class, Boolean.class, Boolean.class }; @Override//www . j a va 2s .c om public Class<?> getColumnClass(int x) { return c[x]; } @Override public boolean isCellEditable(int row, int column) { return false; } }; tblTugas.setModel(m); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("tugas").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); achmad.rifai.erp1.entity.Tugas t = new achmad.rifai.erp1.entity.Tugas(json); if (t.isDeleted()) m.addRow(new Object[] { t.getKode(), t.getNo(), t.getTgl(), t.getKet(), t.isBatal(), t.isPending() }); } }
From source file:achmad.rifai.erp1.entity.Beban.java
public static Beban of(DB d, String kode) throws Exception { Beban b = null;/* www .j av a2 s .com*/ 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.dao.DAOPembelian.java
@Override public List<Pembelian> all() throws Exception { List<Pembelian> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("pembelian").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Pembelian p = new Pembelian(json); if (!p.isDeleted()) l.add(p);//from w ww .j a va 2 s . com } l.sort(sorter()); return l; }
From source file:achmad.rifai.erp1.entity.dao.DAOPenjualan.java
@Override public List<Penjualan> all() throws Exception { List<Penjualan> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("penjualan").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Penjualan p = new Penjualan(json); if (!p.isDeleted()) l.add(p);/*from w w w. j a v a 2 s . co m*/ } l.sort(sorter()); return l; }
From source file:achmad.rifai.erp1.entity.dao.DAOPesan.java
@Override public List<Pesan> all() throws Exception { List<Pesan> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("pesan").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Pesan p = new Pesan(json); if (!p.isDeleted()) l.add(p);//w w w. j a va 2 s . c o m } l.sort(sorter()); return l; }
From source file:achmad.rifai.erp1.entity.dao.DAORekening.java
@Override public List<Rekening> all() throws Exception { List<Rekening> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("rekening").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Rekening re = new Rekening(json); if (!re.isDeleted()) l.add(re);//from w w w.j a va2 s . c om } return l; }
From source file:achmad.rifai.erp1.entity.dao.DAOSuplier.java
@Override public List<Suplier> all() throws Exception { List<Suplier> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("suplier").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Suplier su = new Suplier(json); if (!su.isDeleted()) l.add(su);//from w w w . j a v a 2 s . com } return l; }
From source file:achmad.rifai.erp1.entity.dao.DAOTerima.java
@Override public List<Terima> all() throws Exception { List<Terima> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("terima").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Terima t = new Terima(json); if (!t.isDeleted()) l.add(t);/* w w w .j a v a 2 s. co m*/ } l.sort(sorter()); return l; }
From source file:achmad.rifai.erp1.entity.dao.DAOTracks.java
@Override public List<Tracks> all() throws Exception { List<Tracks> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("tracks").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Tracks t = new Tracks(json); if (!t.isDeleted()) l.add(t);//from w w w . j a v a 2s . co m } l.sort(sorter()); return l; }
From source file:achmad.rifai.erp1.entity.dao.DAOTugas.java
@Override public List<Tugas> all() throws Exception { List<Tugas> l = new java.util.LinkedList<>(); achmad.rifai.erp1.util.RSA r = achmad.rifai.erp1.util.Work.loadRSA(); com.mongodb.DBCursor c = d.getD().getCollectionFromString("tugas").find(); while (c.hasNext()) { com.mongodb.DBObject o = c.next(); com.mongodb.BasicDBList li = (com.mongodb.BasicDBList) o.get("bin"); String json = ""; for (int x = 0; x < li.size(); x++) json += r.decrypt("" + li.get(x)); Tugas t = new Tugas(json); if (!t.isDeleted()) l.add(t);//w w w . jav a2s . c om } l.sort(sorter()); return l; }