I have what may be a pretty elementary Hibernate question. Do HQL (and/or Criteria) update queries cause updates to live domain objects? And do they automatically flush now-invalid domain objects from the first-level cache?
Example:
Player playerReference1 = session.get(Player.class,1);
session.createQuery("update players set gold = 100").executeUpdate();
//Question #1 -- does playerReference1.getGold() now return 100?
Player playerReference2 = session.get(Player.class,1);
//Question #2 -- does playerReference2.getGold() return 100, or is it the same exact object?
Should I make a practice of evicting all objects that are affected by an HQL update if there's a chance some code will need it later?