Code example for SessionFactory

Methods: getCurrentSession

	 * Call the UserService to save the given user while proxying the privileges needed to do so. 
	 * @param user the User to save 
	private void saveUserProperties(User user) {
	 * Get the integer stored for the given user that is their number of login attempts 
	 * @param user the user to check 
	 * @return the # of login attempts for this user defaulting to zero if none defined 
	private Integer getUsersLoginAttempts(User user) {
		String attemptsString = user.getUserProperty(OpenmrsConstants.USER_PROPERTY_LOGIN_ATTEMPTS, "0");
		Integer attempts = 0;
		try { 
			attempts = Integer.valueOf(attemptsString);
Contextual code suggestions in your IDE  Get Codota for Java