Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean add(){
- DBCollection coll = Db.databse.getCollection("Roles");
- DBObject r = new BasicDBObject();
- r.put("name",this.getName());
- DBObject result = coll.findOne(r);
- if(result != null){
- System.out.print("Nop");
- return false;
- }else{
- r.put("description",this.getDescription());
- coll.save(r);
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment