public Personnel load(long personalNr) throws Exception {
        // Try to find it in the cache first:
        Personnel e = cache.get(personalNr);
        if (e != null) {
            return e;
        }

        ResultSet rs = executeSQLQuery("select * from MitarbeiterAlleKlassen p" +
                " where p.personalNr = " + personalNr);

        Personnel personnel;

        if (rs.next()) {
            String lastName = rs.getString("nachname");
            String firstName = rs.getString("vorname");
            Address adr = new Address();
            adr.setStreet(rs.getString("strasse"));
            adr.setHouseNumber(rs.getString("hausNr"));
            adr.setZip(rs.getString("plz"));
            adr.setCity(rs.getString("ortsname"));
            Date birthDate = rs.getDate("gebDatum");
            double salary = rs.getDouble("gehalt");

            if (rs.getLong("wPersNr") != 0) {
                String workplace = rs.getString("arbeitsplatz");
                Worker newWorker =
                        new Worker(personalNr, lastName, firstName, birthDate, adr, workplace);
                newWorker.setSalary(salary);
                personnel = createAndCache(personalNr, newWorker);
            } else if (rs.getLong("aPersNr") != 0) {
                String telephone = rs.getString("telefonNr");
                Employee newEmployee =
                        new Employee(personalNr, lastName, firstName, birthDate, adr, telephone);
                newEmployee.setSalary(salary);
                personnel = createAndCache(personalNr, newEmployee);
                // Try to assign a company car:
                ResultSet rsC = executeSQLQuery("select * from Firmenwagen f" +
                        " where f.personalNr = " + personalNr);
                if (rsC.next()) {
                    CompanyCar car = access.loadCompanyCar(rsC.getString("nummernschild"));
                    newEmployee.setCar(car);
                }
                rsC.close();
                // Try to load projects:
                Set<WorksOn> wOns = access.loadWorksOn(newEmployee);
                for (WorksOn wOn : wOns) {
                    newEmployee.addProject(wOn);
                }
            } else {
                Personnel newPersonnel =
                        new Personnel(personalNr, lastName, firstName, birthDate, adr);
                personnel = createAndCache(personalNr, newPersonnel);
            }
            personnel.setPosition(rs.getString("funktion"));

            long depNr = rs.getLong("abteilungsId");
            if (depNr != 0) {
                personnel.setDepartment(access.loadDepartment(depNr));
            }

            long bossNr = rs.getLong("vorgesetzterNr");
            if (bossNr != 0) {
                // Note: we would get an infinite loop if a personnel
                // is its own boss.
                personnel.setBoss(access.loadPersonnel(bossNr));
            }
            personnel.setAddress(adr);
        } else {
            throw new ObjectNotFoundException(Personnel.class, personalNr + "");
        }

        rs.close();
        return personnel;
    }