person.getPersonRoles().add(Role.getRoleByRoleType(RoleType.PERSON));
person.addPersonRoles(Role.getRoleByRoleType(RoleType.PERSON));
    public Integer run(InfoGrantOwner infoGrantOwner) throws FenixServiceException, ExcepcaoPersistencia {        Person person = null;        GrantOwner grantOwner = null;        Country country = null;        if (infoGrantOwner.getPersonInfo().getInfoPais() != null) {            country = rootDomainObject.readCountryByOID(infoGrantOwner.getPersonInfo().getInfoPais()                    .getIdInternal());        } else {            // If the person country is undefined it is set to default            // "PORTUGUESA NATURAL DO CONTINENTE"            // In a not distance future this will not be needed since the coutry            // can never be null            country = Country.readCountryByNationality("PORTUGUESA NATURAL DO CONTINENTE");        }        // create or edit person information        if (infoGrantOwner.getPersonInfo().getIdInternal() == null) {            person = DomainFactory.makePerson(infoGrantOwner.getPersonInfo(), country);        } else {            person = (Person) rootDomainObject.readPartyByOID(infoGrantOwner.getPersonInfo()                    .getIdInternal());            person.edit(infoGrantOwner.getPersonInfo(), country);        }        // verify if person is new        if (person.getUsername() != null)            grantOwner = checkIfGrantOwnerExists(infoGrantOwner.getGrantOwnerNumber());        // create or edit grantOwner information        Integer maxNumber = null;        if (grantOwner == null) {                        maxNumber = GrantOwner.readMaxGrantOwnerNumber();            grantOwner = DomainFactory.makeGrantOwner();            if (!person.hasRole(RoleType.PERSON)) {                person.getPersonRoles().add(Role.getRoleByRoleType(RoleType.PERSON));            }            person.getPersonRoles().add(Role.getRoleByRoleType(RoleType.GRANT_OWNER));        }                grantOwner = prepareGrantOwner(grantOwner, person, infoGrantOwner, maxNumber);        // Generate the GrantOwner's Person Username        if (person.getUsername() == null || person.getUsername().length() == 0)            person.changeUsername(generateGrantOwnerPersonUsername(grantOwner.getNumber()));        return grantOwner.getIdInternal();    }