@Override
    protected void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate,
                           final Attribute _attribute,
                           final Object... _values)
        throws SQLException
    {
        checkSQLColumnSize(_attribute, 1);
        // if a value was explicitly set the value is used, else the company
        // id from the context
        if ((_values != null) && (_values.length > 0) && _values[0] != null) {
            if (_values[0] instanceof Long) {
                _insertUpdate.column(_attribute.getSqlColNames().get(0), (Long) _values[0]);
            } else {
                _insertUpdate.column(_attribute.getSqlColNames().get(0), Long.parseLong(_values[0].toString()));
            }
        } else {
            // as a defaultvalue the first found Consortium will be inserted
            try {
                final Company company = Context.getThreadContext().getCompany();
                final Set<Long> consortiums = company.getConsortiums();
                if (!consortiums.isEmpty()) {
                    _insertUpdate.column(_attribute.getSqlColNames().get(0), consortiums.iterator().next());
                }
            } catch (final EFapsException e) {
                throw new SQLException("could not fetch consortiums id", e);
            }
        }
    }
@ Override protected void prepare ( final AbstractSQLInsertUpdate < ? > _insertUpdate , final Attribute _attribute , final Object ... _values ) throws SQLException { checkSQLColumnSize ( _attribute , 1 ) ; if ( ( _values != null ) && ( _values . length > 0 ) && _values [ 0 ] != null ) { if ( _values [ 0 ] instanceof Long ) { _insertUpdate . column ( _attribute . getSqlColNames ( ) . get ( 0 ) , ( Long ) _values [ 0 ] ) ; } else { _insertUpdate . column ( _attribute . getSqlColNames ( ) . get ( 0 ) , Long . parseLong ( _values [ 0 ] . toString ( ) ) ) ; } } else { try { final Company company = Context . getThreadContext ( ) . getCompany ( ) ; final Set < Long > consortiums = company . getConsortiums ( ) ; if ( ! consortiums . isEmpty ( ) ) { _insertUpdate . column ( _attribute . getSqlColNames ( ) . get ( 0 ) , consortiums . iterator ( ) . next ( ) ) ; } } catch ( final EFapsException e ) { throw new SQLException ( "could not fetch consortiums id" , e ) ; } } }
@param _insertUpdate     insert / update SQL statement
@param _attribute        Attribute to be prepared
@param _values           values for the insert or update
@throws SQLException if not exact one SQL column for the attribute is
defined of the company id could not be fetched