This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | final List<Player> page1 = manager.executeQuery(query); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | query.setFirstRow(0); | |
| query.setMaxResults(10); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | final Query query = new Query(Player.class, queryOrders); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | final List<QueryOrder> queryOrders = Arrays.asList(new QueryOrder("lastName", true), new QueryOrder("firstName", true)); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | persistenceManager.stream(accountQuery, (QueryMapStream) (o, internalPersistenceManager) -> { | |
| Map accountMap = (Map)o; | |
| try { | |
| // Ensure the property still exists within the data. | |
| if(accountMap.containsKey("balanceDue")) | |
| { | |
| double balanceDue = (double) accountMap.get("balanceDue"); | |
| // This field has been updated to long in the new data model but, the old data model persisted it as an int. So, that is the reason why we cast it as an integer. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | final Query accountQuery = new Query(Account.class, new QueryCriteria("accountId", QueryCriteriaOperator.NOT_NULL)); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | final List<Player> qbs = manager.executeQuery(query); | |
| for (final Player qb : qbs) | |
| { | |
| System.out.println(qb.getFirstName() + " " + qb.getLastName() + ": active=" + qb.getActive()); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | final Query updateQuery = new Query(Player.class, compoundCriteria, updateActiveToFalse); | |
| manager.executeUpdate(updateQuery); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | AttributeUpdate updateActiveToFalse = new AttributeUpdate("active", false); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | final List<Player> players = manager.executeQuery(query); | |
| for (final Player qb : players) | |
| { | |
| System.out.println(qb.getFirstName() + " " + qb.getLastName() + ": active=" + qb.getActive()); | |
| } |