# Applying Unposted Changes to Entity Rows Queried from the Database

When you call entity object association accessor methods, like `getEmployees()` on a `DepartmentImpl` class representing department 20, you get back a `RowIterator` over a set of related `EmployeeImpl` objects for the employees in that department. This entity rowset of appropriate employee entity instances associated to the department 20 is produced by querying the database, so existing employees assigned to department 20 will always show up in the associated entity rowset.

During the current session new Employee entities may be created and existing Employee entities may be modified. By default, unless these new and modified Employee entities are posted or committed, they would not appear in the entity rowset returned by a subsequent call to `getEmployees()` on the same Department entity later in the session. If you want the Business Components for Java framework to perform the extra bookkeeping necessary to provide a cache-consistent entity rowset including any appropriate new and modified entities (in addition to the existing queried entities already reflected in the database) you need to run in full EntityRowSet consistency mode.

There are two approaches to accomplish this:

- If you want all entity rowsets created by entity association accessor methods in your application to consistently include appropriate unposted new and modified entities, then provide the following Java VM parameter on your runtime command line:

      -Djbo.entityrowset.mode="NEW_AND_MODIFIED"

- If you only want to incur the additional overhead of presenting a cache-consistent view of associated entities for a particular rowset, you can call:

      yourRowset.setAssociationConsistent(true);

on just that rowset.