All attributes from this person are read from the database.

@throws EFapsException if the attributes for this person could not be
read
505236
private void readFromDBAttributes()
        throws EFapsException
    {
        Connection con = null;
        try {
            con = Context.getConnection();
            Statement stmt = null;
            try {
                stmt = con.createStatement();

                final StringBuilder cmd = new StringBuilder("select ");
                for (final AttrName attrName : Person.AttrName.values()) {
                    cmd.append(attrName.sqlColumn).append(",");
                }
                cmd.append("0 as DUMMY ").append("from V_USERPERSON ").append("where V_USERPERSON.ID=").append(getId());

                final ResultSet resultset = stmt.executeQuery(cmd.toString());
                if (resultset.next()) {
                    for (final AttrName attrName : Person.AttrName.values()) {
                        final String tmp = resultset.getString(attrName.sqlColumn);
                        setAttrValue(attrName, tmp == null ? null : tmp.trim());
                    }
                }
                resultset.close();
            } catch (final SQLException e) {
                Person.LOG.error("read attributes for person with SQL statement is not " + "possible", e);
                throw new EFapsException(Person.class, "readFromDBAttributes.SQLException", e, getName(), getId());
            } finally {
                try {
                    if (stmt != null) {
                        stmt.close();
                    }
                    con.commit();
                } catch (final SQLException e) {
                    Person.LOG.error("close of SQL statement is not possible", e);
                }
            }
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("could not read child type ids", e);
            }
        }
    }
761591
public DataList getDataList()
        throws EFapsException
    {
        final DataList ret = new DataList();
        while (next()) {
            final ObjectData data = new ObjectData();
            int idx = 1;
            for (final Select select : this.selection.getSelects()) {
                final String key = select.getAlias() == null ? String.valueOf(idx) : select.getAlias();
                data.getValues().add(JSONData.getValue(key, get(select)));
                idx++;
            }
            ret.add(data);
        }
        return ret;
    }
1003155
public List<Instance> getInstances4Attribute(final String _attributeName)
        throws EFapsException
    {
        final OneSelect oneselect = this.attr2OneSelect.get(_attributeName);
        return oneselect == null ? null : oneselect.getInstances();
    }
607650
public void read(final String _readValue)
        throws EFapsException
    {
        if (_readValue != null) {
            try {
                this.props.load(new StringReader(_readValue));
            } catch (final IOException e) {
                throw new EFapsException(PasswordStore.class.getName(), e);
            }
        }
    }
1032183
public static void execute()
        throws EFapsException
    {
        RunLevel.RUNLEVEL.executeMethods();
        final List<String> allInitializer = RunLevel.RUNLEVEL.getAllInitializers();
        for (final AbstractCache<?> cache : AbstractCache.getCaches()) {
            final String initiliazer = cache.getInitializer();
            if (!allInitializer.contains(initiliazer)) {
                cache.clear();
            }
        }
        for (final IRunLevelListener listener : Listener.get().<IRunLevelListener>invoke(IRunLevelListener.class)) {
            listener.onExecute(RunLevel.RUNLEVEL.name);
        }
    }
1171017
protected void checkAccess()
        throws EFapsException
    {
        for (final Instance instance : getInstances()) {
            if (!instance.getType().hasAccess(instance, AccessTypeEnums.DELETE.getAccessType(), null)) {
                LOG.error("Delete not permitted for Person: {} on Instance: {}", Context.getThreadContext().getPerson(),
                                instance);
                throw new EFapsException(getClass(), "execute.NoAccess", instance);
            }
        }
    }
865747
private void initialize(final boolean _step)
        throws EFapsException
    {
        if (!this.init) {
            squash();
            evalAccess();
            this.init = true;
            if (_step) {
                step(this.selection.getAllSelects());
            }
        }
    }
984468
public Object getObject()
        throws EFapsException
    {
        Object ret = null;
        if (this.valueSelect == null) {
            // if the fromSelect has data
            if (this.fromSelect.hasResult()) {
                // and there are more than one id the current object must not be null
                if (this.idList.size() > 1 && this.currentObject != null) {
                    ret = this.fromSelect.getMainOneSelect().getObject(this.currentObject);
                // or if there is only one id the first objectvalue must not be null
                } else if (this.idList.size() == 1 && this.objectList.get(0) != null) {
                    ret = this.fromSelect.getMainOneSelect().getObject(this.currentObject);
                }
            }
        } else {
            // if the currentObject is not null it means that the values are
            // retrieved by iteration through the object list
            if (this.currentId != null) {
                ret = this.valueSelect.getValue(this.currentObject);
            } else {
                ret = this.valueSelect.getValue(this.objectList);
            }
        }
        return ret;
    }
1164105
public static Person get(final UUID _uuid)
        throws EFapsException
    {
        final Cache<UUID, Person> cache = InfinispanCache.get().<UUID, Person>getCache(Person.UUIDCACHE);
        if (!cache.containsKey(_uuid)) {
            Person.getPersonFromDB(Person.SQL_UUID, _uuid.toString());
        }
        return cache.get(_uuid);
    }
833238
protected void setFileInfo(final String _filename,
                               final long _fileLength)
        throws EFapsException
    {
        if (!_filename.equals(this.fileName) || _fileLength != this.fileLength) {
            ConnectionResource res = null;
            try {
                res = Context.getThreadContext().getConnectionResource();
                final AbstractDatabase<?> db = Context.getDbType();
                final StringBuilder cmd = new StringBuilder().append(db.getSQLPart(SQLPart.UPDATE)).append(" ")
                        .append(db.getTableQuote()).append(AbstractStoreResource.TABLENAME_STORE)
                        .append(db.getTableQuote())
                        .append(" ").append(db.getSQLPart(SQLPart.SET)).append(" ")
                        .append(db.getColumnQuote())
                        .append(AbstractStoreResource.COLNAME_FILENAME)
                        .append(db.getColumnQuote()).append(db.getSQLPart(SQLPart.EQUAL)).append("? ")
                        .append(db.getSQLPart(SQLPart.COMMA))
                        .append(db.getColumnQuote())
                        .append(AbstractStoreResource.COLNAME_FILELENGTH)
                        .append(db.getColumnQuote()).append(db.getSQLPart(SQLPart.EQUAL)).append("? ")
                        .append(db.getSQLPart(SQLPart.WHERE)).append(" ")
                        .append(db.getColumnQuote()).append("ID").append(db.getColumnQuote())
                        .append(db.getSQLPart(SQLPart.EQUAL)).append(getGeneralID());

                final PreparedStatement stmt = res.prepareStatement(cmd.toString());
                try {
                    stmt.setString(1, _filename);
                    stmt.setLong(2, _fileLength);
                    stmt.execute();
                } finally {
                    stmt.close();
                }
            } catch (final EFapsException e) {
                throw e;
            } catch (final SQLException e) {
                throw new EFapsException(JDBCStoreResource.class, "write.SQLException", e);
            }
        }
    }
1203153
private void init()
        throws EFapsException
    {
        if (!this.initialized) {
            Listener.LOG.info("Scanning for Listener classes....");
            this.classes.clear();
            this.classes.addAll(new EsjpScanner().scan(EFapsListener.class));

            if (Listener.LOG.isInfoEnabled() && !this.classes.isEmpty()) {
                logClasses("Listener classes found:", this.classes);
            }
            this.initialized = true;
        }
    }
828501
@Override
  public void readSessionData() {
    this.dispatcher.execute(this.userService.isCurrentUserLoggedIn(),
        new AbstractSimpleRestCallback<GwtpSpringSession<T>, Boolean, HttpMessages>(this, this) {

          @Override
          public void onSuccess(final Boolean presult) {
            if (BooleanUtils.isTrue(presult)) {
              // we do have a logged in user, read it
              GwtpSpringSession.this.dispatcher.execute(
                  GwtpSpringSession.this.userService.getCurrentUser(),
                  new AbstractSimpleRestCallback<GwtpSpringSession<T>, T, HttpMessages>(
                      GwtpSpringSession.this, GwtpSpringSession.this) {

                    @Override
                    public void onSuccess(final T presult) {
                      GwtpSpringSession.this.setUser(presult);
                    }
                  });
            } else {
              GwtpSpringSession.this.setUser(null);
            }
          }

        });
  }
374608
public void addAttributeSetSelectPart(final String _attributeSet,
                                          final String _where)
        throws EFapsException
    {
        final Type type;
        // if a previous select exists it is based on the previous select,
        // else it is based on the basic table
        if (this.selectParts.size() > 0) {
            type = this.selectParts.get(this.selectParts.size() - 1).getType();
        } else {
            type = this.query.getMainType();
        }

        try {
            final AttributeSet set = AttributeSet.find(type.getName(), _attributeSet);
            final String linkFrom = set.getName() + "#" + set.getAttributeName();
            this.fromSelect = new LinkFromSelect(linkFrom, getQuery().isCacheEnabled() ? getQuery().getKey() : null);
            this.fromSelect.addWhere(_where);
        } catch (final CacheReloadException e) {
            OneSelect.LOG.error("Could not find AttributeSet for Type: {}, attribute: {}", type.getName(),
                            _attributeSet);
        }
    }
569774
private void executeInserts() throws EFapsException
    {
        ConnectionResource con = null;
        try {
            final Insert insert = (Insert) runnable;
            con = Context.getThreadContext().getConnectionResource();
            long id = 0;
            for (final Entry<SQLTable, AbstractSQLInsertUpdate<?>> entry : updatemap.entrySet()) {
                if (id != 0) {
                    entry.getValue().column(entry.getKey().getSqlColId(), id);
                }
                if (entry.getKey().getSqlColType() != null) {
                    entry.getValue().column(entry.getKey().getSqlColType(), insert.getType().getId());
                }
                final Long created = ((SQLInsert) entry.getValue()).execute(con);
                if (created != null) {
                    id = created;
                    insert.evaluateInstance(created);
                }
            }
        } catch (final SQLException e) {
            throw new EFapsException(SQLRunner.class, "executeOneCompleteStmt", e);
        }
    }
1094664
public boolean next()
        throws EFapsException
    {
        boolean ret = false;
        if (this.iterator == null) {
            this.iterator = this.instances.iterator();
        }
        if (this.iterator.hasNext()) {
            this.current = this.iterator.next();
            ret = true;
        }
        if (ret) {
            for (final OneSelect oneSelect : getAllSelects()) {
                ret = oneSelect.next();
                if (!ret) {
                    break;
                }
            }
        }
        return ret;
    }
1375028
public static void eval(final PermissionSet _permissionSet)
        throws EFapsException
    {
        Evaluation.LOG.debug("Evaluating PermissionSet {}", _permissionSet);
        final Person person = Person.get(_permissionSet.getPersonId());
        final Set<Long> ids = new HashSet<>(person.getRoles());
        ids.addAll(person.getGroups());
        ids.add(person.getId());

        final QueryBuilder userAttrQueryBldr = new QueryBuilder(CIAdminAccess.AccessSet2UserAbstract);
        userAttrQueryBldr.addWhereAttrEqValue(CIAdminAccess.AccessSet2UserAbstract.UserAbstractLink, ids.toArray());

        final QueryBuilder typeAttrQueryBldr = new QueryBuilder(CIAdminAccess.AccessSet2DataModelType);
        typeAttrQueryBldr.addWhereAttrEqValue(CIAdminAccess.AccessSet2DataModelType.DataModelTypeLink, _permissionSet
                        .getTypeId());

        final QueryBuilder queryBldr = new QueryBuilder(CIAdminAccess.AccessSet2Type);
        queryBldr.addWhereAttrInQuery(CIAdminAccess.AccessSet2Type.AccessSetLink, typeAttrQueryBldr.getAttributeQuery(
                        CIAdminAccess.AccessSet2DataModelType.AccessSetLink));
        queryBldr.addWhereAttrInQuery(CIAdminAccess.AccessSet2Type.AccessSetLink, userAttrQueryBldr.getAttributeQuery(
                        CIAdminAccess.AccessSet2UserAbstract.AccessSetLink));
        final CachedMultiPrintQuery multi = queryBldr.getCachedPrint4Request();
        multi.addAttribute(CIAdminAccess.AccessSet2Type.AccessTypeLink);
        multi.executeWithoutAccessCheck();
        while (multi.next()) {
            _permissionSet.addAccessTypeId(multi.<Long>getAttribute(CIAdminAccess.AccessSet2Type.AccessTypeLink));
        }

        final Type type = Type.get(_permissionSet.getTypeId());
        if (type.isCheckStatus()) {
            final QueryBuilder statusQueryBldr = new QueryBuilder(CIAdminAccess.AccessSet2Status);
            statusQueryBldr.addWhereAttrInQuery(CIAdminAccess.AccessSet2Status.AccessSetLink, typeAttrQueryBldr
                            .getAttributeQuery(CIAdminAccess.AccessSet2DataModelType.AccessSetLink));
            statusQueryBldr.addWhereAttrInQuery(CIAdminAccess.AccessSet2Status.AccessSetLink, userAttrQueryBldr
                            .getAttributeQuery(CIAdminAccess.AccessSet2UserAbstract.AccessSetLink));

            final CachedMultiPrintQuery statusMulti = statusQueryBldr.getCachedPrint4Request();
            statusMulti.addAttribute(CIAdminAccess.AccessSet2Status.SatusLink);
            statusMulti.executeWithoutAccessCheck();
            while (statusMulti.next()) {
                final Long statusId = statusMulti.getAttribute(CIAdminAccess.AccessSet2Status.SatusLink);
                final Status status = Status.get(statusId);
                if (status.getStatusGroup().getId() == type.getStatusAttribute().getLink().getId()) {
                    _permissionSet.addStatusId(statusId);
                }
            }
        }
        Evaluation.LOG.debug("Evaluated PermissionSet {}", _permissionSet);
    }
1371506
protected void insertDefaults()
        throws EFapsException
    {
        if (!getExist()[0] && getGeneralID() != null) {
            try {
                final ConnectionResource res = Context.getThreadContext().getConnectionResource();
                Context.getDbType().newInsert(AbstractStoreResource.TABLENAME_STORE, "ID", false)
                                .column("ID", getGeneralID())
                                .column(AbstractStoreResource.COLNAME_FILENAME, "TMP")
                                .column(AbstractStoreResource.COLNAME_FILELENGTH, 0)
                                .execute(res);
                this.fileName = "TMP";
                this.fileLength = new Long(0);
            } catch (final SQLException e) {
                throw new EFapsException(AbstractStoreResource.class, "insertDefaults", e);
            }
        }
    }