Skip to content

Commit

Permalink
Visit Bulk Update and Inserts (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
littlefieldnick committed Nov 12, 2018
1 parent 686f388 commit fa130ed
Show file tree
Hide file tree
Showing 12 changed files with 828 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ private Collection<GrantedAuthority> convertAuthorities(Set<Role> roles) {

return authorities;
}

public org.openhds.domain.model.User getUser(String username){
List<org.openhds.domain.model.User> users = userDao.findByUsername(username);

if (users == null || users.size() == 0) { // no user found by the name
throw new UsernameNotFoundException("user " + username + " was not found");
}

org.openhds.domain.model.User user = users.get(0);
return user;
}


public void setUserDao(UserDao userDao) {
this.userDao = userDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.openhds.domain.model.ClassExtension;
import org.openhds.domain.model.EntityType;
import org.openhds.domain.model.PrivilegeConstants;
import org.openhds.domain.model.SocialGroup;
import org.openhds.domain.model.Visit;

public interface VisitService {
Expand Down Expand Up @@ -49,4 +50,7 @@ public interface VisitService {

@Authorized({ PrivilegeConstants.VIEW_ENTITY })
long getTotalVisitCountForRound(int roundNumber);

@Authorized({PrivilegeConstants.EDIT_ENTITY})
void updateVisit(Visit visit) throws ConstraintViolations;
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,10 @@ public List<Visit> getAllVisitsForRoundInRange(int round, int i, int pageSize) {
public long getTotalVisitCountForRound(int roundNumber) {
return genericDao.getTotalCountWithFilter(Visit.class, "roundNumber", roundNumber);
}

@Override
public void updateVisit(Visit visit) throws ConstraintViolations {
// TODO Auto-generated method stub

}
}
Loading

0 comments on commit fa130ed

Please sign in to comment.