package performa.orm;

import oneit.security.SecUser;


public class CompanyUserNPO extends BaseCompanyUserNPO
{
    private static final long serialVersionUID = 0L;
    
    // This constructor should not be called
    public CompanyUserNPO ()
    {
        // Do not add any code to this, always put it in initialiseNewObject
    }
    
    public Boolean emailExists()
    {
        if(getEmail() != null)
        {
            SecUser user    = SecUser.searchNAME(getTransaction(), getEmail().toLowerCase());

            return user != null && user.getExtension(CompanyUser.REFERENCE_CompanyUser) != null;
        }
        
        return Boolean.FALSE;
    }
}