public void append2SQLSelect ( final SQLSelect _sqlSelect ) { if ( iWhere != null ) { final SQLWhere sqlWhere = _sqlSelect . getWhere ( ) ; for ( final IWhereTerm < ? > term : iWhere . getTerms ( ) ) { if ( term instanceof IWhereElementTerm ) { final IWhereElement element = ( ( IWhereElementTerm ) term ) . getElement ( ) ; if ( element . getAttribute ( ) != null ) { final String attrName = element . getAttribute ( ) ; for ( final Type type : types ) { final Attribute attr = type . getAttribute ( attrName ) ; if ( attr != null ) { addAttr ( _sqlSelect , sqlWhere , attr , term , element ) ; break ; } } } else if ( element . getSelect ( ) != null ) { final IWhereSelect select = element . getSelect ( ) ; for ( final ISelectElement ele : select . getElements ( ) ) { if ( ele instanceof IBaseSelectElement ) { switch ( ( ( IBaseSelectElement ) ele ) . getElement ( ) ) { case STATUS : for ( final Type type : types ) { final Attribute attr = type . getStatusAttribute ( ) ; if ( attr != null ) { addAttr ( _sqlSelect , sqlWhere , attr , term , element ) ; break ; } } break ; default : break ; } } else if ( ele instanceof IAttributeSelectElement ) { final String attrName = ( ( IAttributeSelectElement ) ele ) . getName ( ) ; for ( final Type type : types ) { addAttr ( _sqlSelect , sqlWhere , type . getAttribute ( attrName ) , term , element ) ; } } } } } } } if ( iOrder != null ) { final SQLOrder sqlOrder = _sqlSelect . getOrder ( ) ; for ( final IOrderElement element : iOrder . getElements ( ) ) { for ( final Type type : types ) { final Attribute attr = type . getAttribute ( element . getKey ( ) ) ; if ( attr != null ) { final SQLTable table = attr . getTable ( ) ; final String tableName = table . getSqlTable ( ) ; final TableIdx tableidx = _sqlSelect . getIndexer ( ) . getTableIdx ( tableName ) ; sqlOrder . addElement ( tableidx . getIdx ( ) , attr . getSqlColNames ( ) , element . isDesc ( ) ) ; break ; } } } } }
Append two SQL select .