Comment 0 for bug 839346

Revision history for this message
John Cook (smoulat) wrote :

If not all, than almost all Query implementations have method clone(someParameter). I believe that this is unfortunately chosen name, indicating full cloning of the query. However, these methods build a new query with clone of QueryMetadata . For these methods, I've suggest name like attach(...) or something like that (I know it's not possible because of backward compatibility), and to create another method (well, copy(...) for example, when clone(...) is occupied) performing the same but also copying state of other query fields/metadata not contained in QueryMetadata (like fetchSize for HibernateQuery , etc.).
Again, we have some use cases where full query cloning would be handy but with closed 3-parameter constructor and private access to query fields, we have now very ugly reflection based solution :(.