I'd suggest being very careful using this, or at least being aware of some potential issues. Especially if you either 1) use Oracle, or 2) use DB triggers and attempt to persist an entity a second time within the same session.
With triggers, say you create a new entity using Session.save(). The DB trigger then dynamically replaces some column value, but the entity object cached in Session does not know about this. Later on the same session you try to update that same entity instance. This extended where clause will now fail to find the record due to the mismatch.
With ORacle, the issue is much more insidious. Oracle has this wonderful "feature" where all empty values (i.e., zero-length strings) for varchar columns are replaced with null during insert/update statements. Unfortunately, it does not do the same thing on select statements. So the following:
Code:
INSERT INTO company (id,name) VALUES (1, '');
SELECT * FROM company WHERE name = '';
will fail to find the just inserted record.
Just FYI...