If I use JBoss, EJB3.0, JPA, Hibernate to do a query:
Query q = em.createQuery("SELECT c FROM City c WHERE c.country.id=?").setParameter(1,myCountry.id); List cities = q.getList();
cities.get(i).country == myCountry
cities.get(i).country.equals(myCountry)
"SELECT c FROM City c WHERE c.country.id IN(?,?,?)"are new instances created for entities which have recently been loaded by another user? Would the following return true?
for each ( aCity in userA.cities ) { for each ( bCity in userB.cities ) { if( aCity == bCity ) { // share same object, not just copies of same records return true; } } } return false;