@Test public void addNew() { final Role2 role = new Role2(); role.setAssignMode(AssignMode.AUTHENTICATED); role.setCreationTime(new DateTime()); role.setDescription("Description"); role.setId("Id"); role.setModificationTime(new DateTime()); role.setName("Name"); rolePersonRepo.add(role); log.debug("inserting...."); }
@Override public Role2 add(Role2 roleBaru) { final DBObject dbObject = new EntityToDBObject().apply(roleBaru); rolePersonColl.insert(dbObject); log.info("Role '{}' has been added", roleBaru); return roleBaru; }
MongoRolePersonRepository2 implements RolePersonRepository2 { @Override public Role2 add(Role2 roleBaru) { final DBObject dbObject = new EntityToDBObject().apply(roleBaru); rolePersonColl.insert(dbObject); log.info("Role '{}' has been added", roleBaru); return roleBaru; } }
MongoRolePersonRepository2 implements RolePersonRepository2 { @Override public Role2 add(Role2 roleBaru) { final DBObject dbObject = new EntityToDBObject().apply(roleBaru); rolePersonColl.insert(dbObject); log.info("Role '{}' has been added", roleBaru); return roleBaru; } MongoRolePersonRepository2(final String mongoUri); }
MongoRolePersonRepository2 implements RolePersonRepository2 { @Override public Role2 add(Role2 roleBaru) { final DBObject dbObject = new EntityToDBObject().apply(roleBaru); rolePersonColl.insert(dbObject); log.info("Role '{}' has been added", roleBaru); return roleBaru; } MongoRolePersonRepository2(final String mongoUri); @Override List<Role2> addAll(List<Role2> upRoleList); @Override List<Role2> findAll(); @Override Page<Role2> findAll(String searchText, Pageable pageable); @Override long count(String searchText); @Override Role2 findOne(String id); @Override //method Role2 add(Role2 roleBaru); @Override Role2 modify(String id, Role2 upRole); @Override Role2 addDomain(String id, Role2 upRole); }
MongoRolePersonRepository2 implements RolePersonRepository2 { @Override public Role2 add(Role2 roleBaru) { final DBObject dbObject = new EntityToDBObject().apply(roleBaru); rolePersonColl.insert(dbObject); log.info("Role '{}' has been added", roleBaru); return roleBaru; } MongoRolePersonRepository2(final String mongoUri); @Override List<Role2> addAll(List<Role2> upRoleList); @Override List<Role2> findAll(); @Override Page<Role2> findAll(String searchText, Pageable pageable); @Override long count(String searchText); @Override Role2 findOne(String id); @Override //method Role2 add(Role2 roleBaru); @Override Role2 modify(String id, Role2 upRole); @Override Role2 addDomain(String id, Role2 upRole);  }