@Override
    public QStringValue prepare(final AbstractTypeQuery _query,
                                final AbstractQPart _part)
        throws EFapsException
    {
        if (_part instanceof AbstractQAttrCompare) {
            if (((AbstractQAttrCompare) _part).isIgnoreCase()) {
                this.value = this.value.toUpperCase(Context.getThreadContext().getLocale());
            }
            if (_part instanceof QMatch) {
                this.value = Context.getDbType().prepare4Match(this.value);
            }
            if (_part instanceof QEqual && ((QEqual) _part).getAttribute().getAttribute() != null) {
                // check if the string is an status key and must be converted in
                // a long
                if (((QEqual) _part).getAttribute().getAttribute().getParent().isCheckStatus()
                                && ((QEqual) _part).getAttribute().getAttribute().equals(
                                   ((QEqual) _part).getAttribute().getAttribute().getParent().getStatusAttribute())) {
                    final Status status;
                    if (StringUtils.isNumeric(this.value)) {
                        status = Status.get(Long.valueOf(this.value));
                    } else {
                        status = Status.find(
                                        ((QEqual) _part).getAttribute().getAttribute().getLink().getUUID(), this.value);
                    }
                    if (status != null) {
                        this.value = Long.valueOf(status.getId()).toString();
                        this.noEscape = true;
                    }
                 // check if the string is an oid and must be converted in a long
                } else if (((QEqual) _part).getAttribute().getAttribute().hasLink()) {
                    final Instance insTmp = Instance.get(this.value);
                    if (insTmp.isValid()) {
                        this.value = Long.valueOf(insTmp.getId()).toString();
                        this.noEscape = true;
                    }
                }
            }
        }
        return this;
    }
@ Override public QStringValue prepare ( final AbstractTypeQuery _query , final AbstractQPart _part ) throws EFapsException { if ( _part instanceof AbstractQAttrCompare ) { if ( ( ( AbstractQAttrCompare ) _part ) . isIgnoreCase ( ) ) { this . value = this . value . toUpperCase ( Context . getThreadContext ( ) . getLocale ( ) ) ; } if ( _part instanceof QMatch ) { this . value = Context . getDbType ( ) . prepare4Match ( this . value ) ; } if ( _part instanceof QEqual && ( ( QEqual ) _part ) . getAttribute ( ) . getAttribute ( ) != null ) { if ( ( ( QEqual ) _part ) . getAttribute ( ) . getAttribute ( ) . getParent ( ) . isCheckStatus ( ) && ( ( QEqual ) _part ) . getAttribute ( ) . getAttribute ( ) . equals ( ( ( QEqual ) _part ) . getAttribute ( ) . getAttribute ( ) . getParent ( ) . getStatusAttribute ( ) ) ) { final Status status ; if ( StringUtils . isNumeric ( this . value ) ) { status = Status . get ( Long . valueOf ( this . value ) ) ; } else { status = Status . find ( ( ( QEqual ) _part ) . getAttribute ( ) . getAttribute ( ) . getLink ( ) . getUUID ( ) , this . value ) ; } if ( status != null ) { this . value = Long . valueOf ( status . getId ( ) ) . toString ( ) ; this . noEscape = true ; } } else if ( ( ( QEqual ) _part ) . getAttribute ( ) . getAttribute ( ) . hasLink ( ) ) { final Instance insTmp = Instance . get ( this . value ) ; if ( insTmp . isValid ( ) ) { this . value = Long . valueOf ( insTmp . getId ( ) ) . toString ( ) ; this . noEscape = true ; } } } } return this ; }
{@inheritDoc}