The instance method reads all information from the database.

@throws EFapsException on error
@see #readFromDBAttributes()
424710
protected void readFromDB()
        throws EFapsException
    {
        readFromDBAttributes();
        this.roles.clear();
        for (final Role role : getRolesFromDB()) {
            add(role);
        }
        this.groups.clear();
        for (final Group group : getGroupsFromDB(null)) {
            add(group);
        }
        this.companies.clear();
        for (final Company company : getCompaniesFromDB(null)) {
            add(company);
        }
        this.associations.clear();
        for (final Association association : getAssociationsFromDB(null)) {
            add(association);
        }
    }
652482
public void readData(FieldTable table) throws DBException
    {
        if (this.getLookupKey() instanceof String)
        {
            FieldList record = table.getRecord();
            String strTableName = (String)this.getLookupKey();
            String strDBName = null;
            if (strTableName != null)
            {
                if (strTableName.lastIndexOf('/') != -1)
                {
                    strDBName = strTableName.substring(0, strTableName.lastIndexOf('/'));
                    if (strDBName.lastIndexOf('/') != -1)
                        strDBName = strDBName.substring(strDBName.lastIndexOf('/') + 1);
                    strTableName = strTableName.substring(strTableName.lastIndexOf('/') + 1);
                    if (strTableName.indexOf('.') != -1)
                        strTableName = strTableName.substring(0, strTableName.indexOf('.'));
                }
            }

            String strThickRecordClass = record.getClass().getName();
            
            RecordOwner recordOwner = ((Record)record).getRecordOwner();
            BaseDatabase database = (BaseDatabase)recordOwner.getDatabase(record.getDatabaseName(), record.getDatabaseType(), null);
            Record recSource = Record.makeRecordFromClassName(strThickRecordClass, recordOwner, false, true);
            if (recSource == null)
                return;
            if (strTableName != null)
                if (strTableName.length() > 0)
                    if ((!strTableName.equalsIgnoreCase(recSource.getTableNames(false))))
                        if ((recSource.getDatabaseType() & DBConstants.MAPPED) != 0)
                            recSource.setTableNames(strTableName);
            recSource.setTable(database.makeTable(recSource));
            recSource.init(recordOwner);

            recSource.populateThinTable(record, true);
            
            recSource.free();
        }
    }
104459
private void addCreateUpdateAttributes() throws EFapsException
    {
        final Iterator<?> iter = getType().getAttributes().entrySet().iterator();
        while (iter.hasNext()) {
            final Map.Entry<?, ?> entry = (Map.Entry<?, ?>) iter.next();
            final Attribute attr = (Attribute) entry.getValue();
            final AttributeType attrType = attr.getAttributeType();
            if (attrType.isCreateUpdate()) {
                addInternal(attr, false, (Object) null);
            }
            if (attr.getDefaultValue() != null) {
                addInternal(attr, false, attr.getDefaultValue());
            }
        }
    }
1077991
public void executeWithoutTrigger()
        throws EFapsException
    {
        if (Update.STATUSOK.getStati().isEmpty()) {
            final Context context = Context.getThreadContext();
            ConnectionResource con = null;
            try {
                con = context.getConnectionResource();
                for (final Entry<SQLTable, List<Value>> entry : this.table2values.entrySet()) {
                    final SQLUpdate update = Context.getDbType().newUpdate(entry.getKey().getSqlTable(),
                                    entry.getKey().getSqlColId(),
                                    getInstance().getId());
                    // iterate in reverse order and only execute the ones that are not added yet, permitting
                    // to overwrite the value for attributes by adding them later
                    final ReverseListIterator<Value> iterator = new ReverseListIterator<>(entry.getValue());

                    final Set<String> added = new HashSet<>();
                    while (iterator.hasNext()) {
                        final Value value = iterator.next();
                        final String colKey = value.getAttribute().getSqlColNames().toString();
                        if (!added.contains(colKey)) {
                            value.getAttribute().prepareDBUpdate(update, value.getValues());
                            added.add(colKey);
                        }
                    }
                    final Set<String> updatedColumns = update.execute(con);
                    final Iterator<Entry<Attribute, Value>> attrIter = this.trigRelevantAttr2values.entrySet()
                                    .iterator();
                    while (attrIter.hasNext()) {
                        final Entry<Attribute, Value> trigRelEntry = attrIter.next();
                        if (trigRelEntry.getKey().getTable().equals(entry.getKey())) {
                            boolean updated = false;
                            for (final String colName : trigRelEntry.getKey().getSqlColNames()) {
                                if (updatedColumns.contains(colName)) {
                                    updated = true;
                                    break;
                                }
                            }
                            if (!updated) {
                                attrIter.remove();
                            }
                        }
                    }
                }
                AccessCache.registerUpdate(getInstance());
                Queue.registerUpdate(getInstance());
            } catch (final SQLException e) {
                Update.LOG.error("Update of '" + this.instance + "' not possible", e);
                throw new EFapsException(getClass(), "executeWithoutTrigger.SQLException", e, this.instance);
            }
        } else {
            throw new EFapsException(getClass(), "executeWithout.StatusInvalid", Update.STATUSOK.getStati());
        }
    }
616394
<A extends BasicFileAttributes> A readAttributes(File file, Class<A> type) {
    state.checkOpen();
    return attributes.readAttributes(file, type);
  }
195737
private void checkAccess()
        throws EFapsException
    {
        // check the access for the given instances
        final Map<Instance, Boolean> accessmap = new HashMap<Instance, Boolean>();
        for (final Entry<Type, List<Instance>> entry : this.typeMapping.entrySet()) {
            accessmap.putAll(entry.getKey().checkAccess(entry.getValue(), AccessTypeEnums.SHOW.getAccessType()));
        }
        this.elements.entrySet().removeIf(entry -> accessmap.size() > 0 && (!accessmap.containsKey(entry.getKey())
                        || !accessmap.get(entry.getKey())));
    }
1022242
def attributes
      attrs = {}
      attribute_names.each { |name| attrs[name] = read_attribute(name) }
      attrs
    end
1155009
public void open() throws DBException
    {
        super.open();
        this.getRecord().setEditMode(DBConstants.EDIT_NONE);    // Being careful
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
            {
                this.syncRecordToBase(table.getRecord(), this.getRecord(), true); // Note: I am syncing the base to the alt here
                table.open();
            }
        }
    }
1185389
public AbstractPrintQuery addAttribute(final String... _attrNames)
        throws EFapsException
    {
        final Type type = getMainType();
        if (type != null) {
            for (final String attrName : _attrNames) {
                final Attribute attr = type.getAttribute(attrName);
                if (attr == null) {
                    final AttributeSet set = AttributeSet.find(type.getName(), attrName);
                    if (set != null) {
                        addAttributeSet(set);
                    }
                } else {
                    addAttribute(attr);
                }
            }
        }
        return this;
    }
1209173
public static Timestamp getCurrentTimeFromDB() throws EFapsException
    {
        Timestamp now = null;
        final ConnectionResource rsrc = Context.getThreadContext().getConnectionResource();
        final Statement stmt;
        try {
            stmt = rsrc.createStatement();
            final ResultSet resultset = stmt.executeQuery("SELECT " + Context.getDbType().getCurrentTimeStamp());
            resultset.next();
            now = resultset.getTimestamp(1);
            resultset.close();
            stmt.close();
        } catch (final SQLException e) {
            DateTimeUtil.LOG.error("could not execute SQL-Statement", e);
        }
        return now;
    }
1096926
protected Attribute attribute(final Select _select)
        throws EFapsException
    {
        Attribute ret = null;
        final AbstractElement<?> element = _select.getElements().get(_select.getElements().size() - 1);
        if (element instanceof AttributeElement) {
            ret = ((AttributeElement) element).getAttribute();
        }
        return ret;
    }
602728
private void prepareQuery()
        throws EFapsException
    {
        for (final QueryBuilder queryBldr : this.attrQueryBldrs.values()) {
            final AttributeQuery attrQuery = queryBldr.getAttributeQuery();
            this.addWhereAttrInQuery(queryBldr.getLinkAttributeName(), attrQuery);
        }

        if (!this.types.isEmpty()) {
            // force the include
            this.query.setIncludeChildTypes(true);
            final Type baseType = Type.get(this.typeUUID);
            final QEqual eqPart = new QEqual(new QAttribute(baseType.getTypeAttribute()));

            for (final UUID type : this.types) {
                eqPart.addValue(new QNumberValue(Type.get(type).getId()));
            }
            this.compares.add(eqPart);
        }

        if (!this.compares.isEmpty()) {
            final QAnd and = this.or ? new QOr() : new QAnd();
            for (final AbstractQAttrCompare compare : this.compares) {
                and.addPart(compare);
            }
            this.query.setWhere(new QWhereSection(and));
        }
        if (!this.orders.isEmpty()) {
            final QOrderBySection orderBy = new QOrderBySection(
                            this.orders.toArray(new AbstractQPart[this.orders.size()]));
            this.query.setOrderBy(orderBy);
        }
        if (this.limit > 0) {
            this.query.setLimit(this.limit);
        }
    }
1321690
protected void readFromDB4Properties()
        throws CacheReloadException
    {
        Connection con = null;
        try {
            con = Context.getConnection();
            final PreparedStatement stmt = con.prepareStatement(AbstractAdminObject.SELECT);
            stmt.setObject(1, getId());
            final ResultSet rs = stmt.executeQuery();
            AbstractAdminObject.LOG.debug("Reading Properties for '{}'", getName());
            while (rs.next()) {
                final String nameStr = rs.getString(1).trim();
                final String value = rs.getString(2).trim();
                setProperty(nameStr, value);
                AbstractAdminObject.LOG.debug("    Name: '{}' - Value: '{}'", new Object[] { nameStr, value });
            }
            rs.close();
            stmt.close();
            con.commit();
            con.close();
        } catch (final SQLException e) {
            throw new CacheReloadException("could not read properties for " + "'" + getName() + "'", e);
        } catch (final EFapsException e) {
            throw new CacheReloadException("could not read properties for " + "'" + getName() + "'", e);
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("Cannot read a type for an attribute.", e);
            }
        }
    }
433652
public final Collection<Map<String, ?>> getData()
        throws EFapsException
    {
        final Collection<Map<String, ?>> ret = new ArrayList<>();
        while (next()) {
            final Map<String, ?> map = new LinkedHashMap<>();
            int idx = 1;
            for (final Select select : this.selection.getSelects()) {
                final String key = select.getAlias() == null ? String.valueOf(idx) : select.getAlias();
                map.put(key, get(select));
                idx++;
            }
            ret.add(map);
        }
        return ret;
    }
983427
@Override
	public void execute(Map<String, Object> attributes) throws FrameworkException {

		final String nodeType         = (String) attributes.get("type");
		final String relType          = (String) attributes.get("relType");
		final Boolean allNodes        = (Boolean) attributes.get("allNodes");
		final Boolean allRels         = (Boolean) attributes.get("allRels");
		final DatabaseService graphDb = (DatabaseService) arguments.get("graphDb");

		final SecurityContext superUserContext = SecurityContext.getSuperUserInstance();
		final NodeFactory nodeFactory          = new NodeFactory(superUserContext);
		final RelationshipFactory relFactory   = new RelationshipFactory(superUserContext);

		if (nodeType != null || Boolean.TRUE.equals(allNodes)) {

			Iterator<AbstractNode> nodeIterator = null;

			if (Boolean.TRUE.equals(allNodes)) {

				nodeIterator = Iterables.map(nodeFactory, graphDb.getAllNodes()).iterator();

				info("Start setting UUID on all nodes");

			} else {

				nodeIterator = Iterables.map(nodeFactory, graphDb.getNodesByTypeProperty(nodeType)).iterator();

				info("Start setting UUID on nodes of type {}", new Object[] { nodeType });
			}

			final long count = bulkGraphOperation(securityContext, nodeIterator, 1000, "SetNodeUuid", new BulkGraphOperation<AbstractNode>() {

				@Override
				public boolean handleGraphObject(final SecurityContext securityContext, final AbstractNode node) {

					try {

						if (node.getProperty(GraphObject.id) == null) {

							node.unlockSystemPropertiesOnce();
							node.setProperty(GraphObject.id, NodeServiceCommand.getNextUuid());
						}

					} catch (FrameworkException fex) {

						logger.warn("Unable to set UUID of node {}", node, fex);
					}

					return true;
				}

				@Override
				public void handleThrowable(SecurityContext securityContext, Throwable t, AbstractNode node) {
					logger.warn("Unable to set UUID of node {}", node, t);
				}

				@Override
				public void handleTransactionFailure(SecurityContext securityContext, Throwable t) {
					logger.warn("Unable to set UUID on node", t);
				}

				@Override
				public boolean doValidation() {
					return false;
				}
			});

			info("Done with setting UUID on {} nodes", count);

			return;
		}

		if (relType != null || Boolean.TRUE.equals(allRels)) {

			Iterator<AbstractRelationship> relIterator = null;

			if (Boolean.TRUE.equals(allRels)) {

				relIterator = Iterables.map(relFactory, graphDb.getAllRelationships()).iterator();

				info("Start setting UUID on all rels");

			} else {

				relIterator = Iterables.map(relFactory, graphDb.getRelationshipsByType(relType)).iterator();

				info("Start setting UUID on rels of type {}", relType);
			}

			final long count = bulkGraphOperation(securityContext, relIterator, 1000, "SetRelationshipUuid", new BulkGraphOperation<AbstractRelationship>() {

				@Override
				public boolean handleGraphObject(SecurityContext securityContext, AbstractRelationship rel) {

					try {

						if (rel.getProperty(GraphObject.id) == null) {

							rel.unlockSystemPropertiesOnce();
							rel.setProperty(GraphObject.id, NodeServiceCommand.getNextUuid());
						}

					} catch (FrameworkException fex) {

						logger.warn("Unable to set UUID of relationship {}: {}", new Object[] { rel, fex.getMessage() });
					}

					return true;
				}

				@Override
				public void handleThrowable(SecurityContext securityContext, Throwable t, AbstractRelationship rel) {
					logger.warn("Unable to set UUID of relationship {}: {}", rel, t.getMessage());
				}

				@Override
				public void handleTransactionFailure(SecurityContext securityContext, Throwable t) {
					logger.warn("Unable to set UUID on relationships {}", t.toString());
				}

				@Override
				public boolean doValidation() {
					return false;
				}
			});

			info("Done with setting UUID on {} relationships", count);

			return;
		}

		info("Unable to determine entity type to set UUID.");

	}
584660
public static void index()
        throws EFapsException
    {
        final List<IndexDefinition> defs = IndexDefinition.get();
        for (final IndexDefinition def : defs) {
            final QueryBuilder queryBldr = new QueryBuilder(def.getUUID());
            final InstanceQuery query = queryBldr.getQuery();
            index(query.execute());
        }
    }
104244
public void read(AttributeSet other) {

      for (Iterator<Attribute<?>> iterator = attributes.values().iterator(); iterator.hasNext();) {
         Attribute<Object> attribute = (Attribute<Object>) iterator.next();

         Attribute<Object> a = other.attribute(attribute.name());
         if (a.isModified()) {
            attribute.read(a);
         }
      }
   }