/**
  * Add all of the relevant query settings from an EJBQLParseTree to the given database query.
  *
  * @param query The query to populate
  * @param session The session to use to information such as descriptors.
  */
 public void populateQuery(DatabaseQuery query, AbstractSession session) {
   if (query.isObjectLevelReadQuery()) {
     ObjectLevelReadQuery objectQuery = (ObjectLevelReadQuery) query;
     GenerationContext generationContext = buildContext(objectQuery, session);
     populateReadQueryInternal(objectQuery, generationContext);
   } else if (query.isUpdateAllQuery()) {
     UpdateAllQuery updateQuery = (UpdateAllQuery) query;
     GenerationContext generationContext = buildContext(updateQuery, session);
     populateModifyQueryInternal(updateQuery, generationContext);
     addUpdatesToQuery(updateQuery, generationContext);
   } else if (query.isDeleteAllQuery()) {
     DeleteAllQuery deleteQuery = (DeleteAllQuery) query;
     GenerationContext generationContext = buildContext(deleteQuery, session);
     populateModifyQueryInternal(deleteQuery, generationContext);
   }
 }