Buggy code:
public { } public void setClob ( PreparedStatement stmnt , int idx , Clob val , Column col ) throws SQLException { } public void setClobString ( PreparedStatement stmnt , int idx , String val , Column col ) throws SQLException { } public void setDate ( PreparedStatement stmnt , int idx , java . util . Date val , Column col ) throws SQLException { } public void setDate ( PreparedStatement stmnt , int idx , Date val , Calendar cal , Column col ) throws SQLException { } public void setCalendar ( PreparedStatement stmnt , int idx , Calendar val , Column col ) throws SQLException { } public void setDouble ( PreparedStatement stmnt , int idx , double val , Column col ) throws SQLException { } public void setFloat ( PreparedStatement stmnt , int idx , float val , Column col ) throws SQLException { } public void setInt ( PreparedStatement stmnt , int idx , int val , Column col ) throws SQLException { } public void setLong ( PreparedStatement stmnt , int idx , long val , Column col ) throws SQLException { } public void setLocale ( PreparedStatement stmnt , int idx , Locale val , Column col ) throws SQLException { } public void setNull ( PreparedStatement stmnt , int idx , int colType , Column col ) throws SQLException { } public void setNumber ( PreparedStatement stmnt , int idx , Number num , Column col ) throws SQLException { } public void setObject ( PreparedStatement stmnt , int idx , Object val , int colType , Column col ) throws SQLException { } public void setRef ( PreparedStatement stmnt , int idx , Ref val , Column col ) throws SQLException { } public void setShort ( PreparedStatement stmnt , int idx , short val , Column col ) throws SQLException { } public void setString ( PreparedStatement stmnt , int idx , String val , Column col ) throws SQLException { } public void setTime ( PreparedStatement stmnt , int idx , Time val , Calendar cal , Column col ) throws SQLException { } public void setTimestamp ( PreparedStatement stmnt , int idx , Timestamp val , Calendar cal , Column col ) throws SQLException { } public void setTyped ( PreparedStatement stmnt , int idx , Object val , Column col , int type , JDBCStore store ) throws SQLException { } public void setUnknown ( PreparedStatement stmnt , int idx , Object val , Column col ) throws SQLException { } public byte [ ] serialize ( Object val , JDBCStore store ) throws SQLException { } public void putBytes ( Object blob , byte [ ] data ) throws SQLException { } public void putString ( Object clob , String data ) throws SQLException { } public void putChars ( Object clob , char [ ] data ) throws SQLException { } private static Object invokePutLobMethod ( Method method , Object target , Object [ ] args ) throws SQLException { } protected void storageWarning ( Object orig , Object converted ) { } public int getJDBCType ( int metaTypeCode , boolean lob ) { } public int getJDBCType ( int metaTypeCode , boolean lob , int precis , int scale ) { } public int getPreferredType ( int type ) { } public String getTypeName ( Column col ) { } public String getTypeName ( int type ) { } protected String appendSize ( Column col , String typeName ) { } protected String insertSize ( String typeName , String size ) { } public void setJoinSyntax ( String syntax ) { } public String getPlaceholderValueString ( Column col ) { } public SQLBuffer toSelectCount ( Select sel ) { } public SQLBuffer toDelete ( ClassMapping mapping , Select sel , Object [ ] params ) { } public SQLBuffer toUpdate ( ClassMapping mapping , Select sel , JDBCStore store , Object [ ] params , Map updates ) { } protected SQLBuffer toBulkOperation ( ClassMapping mapping , Select sel , JDBCStore store , Object [ ] params , Map updateParams ) { SQLBuffer sql = new SQLBuffer ( this ) ; if ( updateParams == null ) { if ( requiresTargetForDelete ) { sql . append ( "DELETE<seq2seq4repair_space>" ) ; SQLBuffer deleteTargets = getDeleteTargets ( sel ) ; sql . append ( deleteTargets ) ; sql . append ( "<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) ; } else { sql . append ( "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) ; } } else sql . append ( "UPDATE<seq2seq4repair_space>" ) ; sel . addJoinClassConditions ( ) ; if ( ( ( ( sel . getTableAliases ( ) . size ( ) ) == 1 ) && ( supportsSubselect ) ) && ( allowsAliasInBulkClause ) ) { SQLBuffer from ; if ( ( sel . getFromSelect ( ) ) != null ) from = getFromSelect ( sel , false ) ; else from = getFrom ( sel , false ) ; sql . append ( from ) ; appendUpdates ( sel , store , sql , params , updateParams , allowsAliasInBulkClause ) ; SQLBuffer where = sel . getWhere ( ) ; if ( ( where != null ) && ( ! ( where . isEmpty ( ) ) ) ) { sql . append ( "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) ; sql . append ( where ) ; } return sql ; } Table table = mapping . getTable ( ) ; String tableName = getFullName ( table , false ) ; if ( ( ( sel . getWhere ( ) ) == null ) || ( sel . getWhere ( ) . isEmpty ( ) ) ) { sql . append ( tableName ) ; appendUpdates ( sel , store , sql , params , updateParams , false ) ; return sql ; } if ( ( ! ( supportsSubselect ) ) || ( ! ( supportsCorrelatedSubselect ) ) ) return null ; Column [ ] pks = mapping . getPrimaryKeyColumns ( ) ; sel . clearSelects ( ) ; sel . setDistinct ( true ) ; if ( ( pks . length ) == 1 ) { sel . select ( pks [ 0 ] ) ; sql . append ( tableName ) ; appendUpdates ( sel , store , sql , params , updateParams , false ) ; sql . append ( "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) . append ( pks [ 0 ] ) . append ( "<seq2seq4repair_space>IN<seq2seq4repair_space>(" ) . append ( sel . toSelect ( false , null ) ) . append ( ")" ) ; } else { sel . clearSelects ( ) ; sel . setDistinct ( false ) ; sel . select ( "1" , null ) ; Column [ ] cols = table . getPrimaryKey ( ) . getColumns ( ) ; SQLBuffer buf = new SQLBuffer ( this ) ; buf . append ( "(" ) ; for ( int i = 0 ; i < ( cols . length ) ; i ++ ) { if ( i > 0 ) buf . append ( "<seq2seq4repair_space>AND<seq2seq4repair_space>" ) ; <START_BUG> buf . append ( sel . getColumnAlias ( cols [ i ] , null ) ) . append ( "<seq2seq4repair_space>=<seq2seq4repair_space>" ) . append ( table ) . append ( catalogSeparator ) . append ( cols [ i ] ) ; <END_BUG>

Fix:
buf . append ( sel . getColumnAlias ( cols [ i ] ) ) . append ( "<seq2seq4repair_space>=<seq2seq4repair_space>" ) . append ( table ) . append ( catalogSeparator ) . append ( cols [ i ] ) ;