@SuppressWarnings({"unchecked"}) public Object execute(Object o) throws G16CommonBusinessException, HibernateEXC { Map<Integer, SystemUserEntity> map = (Map<Integer, SystemUserEntity>) o; SystemUserEntity argument = map.get(0); /** the username should be ACTIVE */ argument.setStatus(SystemUserEntity.StatusTypeEnumeration.ACTIVE); LOG.info( "An attemp for login occured by username="******"; and status is=") .concat(argument.getStatus())); argument.setPassword(SecurityAlgorithm.encrypt(argument.getPassword())); /** * Checks the 1) username should be the same as user has been entered 2) password should be the * same as user has been entered 3) status should be active. */ return Expression.and( Expression.and( Expression.eq("userName", argument.getUserName()), Expression.eq("password", argument.getPassword())), Expression.eq("status", argument.getStatus())); }