protected void addAttributes(final boolean _inherited,
                                 final Attribute... _attributes)
        throws CacheReloadException
    {
        for (final Attribute attribute : _attributes) {
            if (!this.attributes.containsKey(attribute.getName())) {
                Type.LOG.trace("adding Attribute:'{}' to type: '{}'", attribute.getName(), getName());
                // evaluate for type attribute
                if (attribute.getAttributeType().getClassRepr().equals(TypeType.class)) {
                    this.typeAttributeName = attribute.getName();
                } else if (attribute.getAttributeType().getClassRepr().equals(StatusType.class) && !_inherited) {
                    // evaluate for status, an inherited attribute will not
                    // overwrite the original attribute
                    this.statusAttributeName = attribute.getName();
                } else if (attribute.getAttributeType().getClassRepr().equals(CompanyLinkType.class)
                                || attribute.getAttributeType().getClassRepr().equals(ConsortiumLinkType.class)) {
                    // evaluate for company
                    this.companyAttributeName = attribute.getName();
                } else if (attribute.getAttributeType().getClassRepr().equals(GroupLinkType.class)) {
                    // evaluate for group
                    this.groupAttributeName = attribute.getName();
                }
                this.attributes.put(attribute.getName(), attribute);
                if (attribute.getTable() != null) {
                    this.tables.add(attribute.getTable());
                    attribute.getTable().addType(getId());
                    if (getMainTable() == null) {
                        setMainTable(attribute.getTable());
                    }
                }
                setDirty();
            }
        }
    }
protected void addAttributes ( final boolean _inherited , final Attribute ... _attributes ) throws CacheReloadException { for ( final Attribute attribute : _attributes ) { if ( ! this . attributes . containsKey ( attribute . getName ( ) ) ) { Type . LOG . trace ( "adding Attribute:'{}' to type: '{}'" , attribute . getName ( ) , getName ( ) ) ; if ( attribute . getAttributeType ( ) . getClassRepr ( ) . equals ( TypeType . class ) ) { this . typeAttributeName = attribute . getName ( ) ; } else if ( attribute . getAttributeType ( ) . getClassRepr ( ) . equals ( StatusType . class ) && ! _inherited ) { this . statusAttributeName = attribute . getName ( ) ; } else if ( attribute . getAttributeType ( ) . getClassRepr ( ) . equals ( CompanyLinkType . class ) || attribute . getAttributeType ( ) . getClassRepr ( ) . equals ( ConsortiumLinkType . class ) ) { this . companyAttributeName = attribute . getName ( ) ; } else if ( attribute . getAttributeType ( ) . getClassRepr ( ) . equals ( GroupLinkType . class ) ) { this . groupAttributeName = attribute . getName ( ) ; } this . attributes . put ( attribute . getName ( ) , attribute ) ; if ( attribute . getTable ( ) != null ) { this . tables . add ( attribute . getTable ( ) ) ; attribute . getTable ( ) . addType ( getId ( ) ) ; if ( getMainTable ( ) == null ) { setMainTable ( attribute . getTable ( ) ) ; } } setDirty ( ) ; } } }
Add attributes to this type and all child types of this type.
Recursive method.
@param _inherited is the attribute inherited or form this type
@param _attributes attributes to add
@throws CacheReloadException on error