docs: @Override
      public boolean persist(TaskRecord updates, TaskRecord expected) throws Exception {
          StringBuilder update = new StringBuilder(220)
                          .append("UPDATE Task t SET ");
          if (updates != null) {
              if (updates.hasIdentifierOfClassLoader())
                  update.append("t.LOADER=:c2,");
              if (updates.hasIdentifierOfOwner())
                  update.append("t.OWNR=:o2,");
              if (updates.hasIdentifierOfPartition())
                  update.append("t.PARTN=:p2,");
              if (updates.hasMiscBinaryFlags())
                  update.append("t.MBITS=:m2,");
              if (updates.hasName())
                  update.append("t.INAME=:n2,");
              if (updates.hasNextExecutionTime())
                  update.append("t.NEXTEXEC=:ne2,");
              if (updates.hasOriginalSubmitTime())
                  update.append("t.ORIGSUBMT=:os2,");
              if (updates.hasPreviousScheduledStartTime())
                  update.append("t.PREVSCHED=:sc2,");
              if (updates.hasPreviousStartTime())
                  update.append("t.PREVSTART=:sa2,");
              if (updates.hasPreviousStopTime())
                  update.append("t.PREVSTOP=:so2,");
              if (updates.hasResult())
                  update.append("t.RESLT=:r2,");
              if (updates.hasConsecutiveFailureCount())
                  update.append("t.RFAILS=:f2,");
              if (updates.hasState())
                  update.append("t.STATES=:s2,");
              if (updates.hasTask())
                  update.append("t.TASKB=:t2,");
              if (updates.hasTaskInformation())
                  update.append("t.TASKINFO=:ti2,");
              if (updates.hasTrigger())
                  update.append("t.TRIG=:tr2,");
          }
  
          update.append("t.VERSION=t.VERSION+1 WHERE t.ID=:i");
  
          if (expected.hasIdentifierOfClassLoader())
              update.append(" AND t.LOADER=:c1");
          if (expected.hasIdentifierOfOwner())
              update.append(" AND t.OWNR=:o1");
          if (expected.hasIdentifierOfPartition())
              update.append(" AND t.PARTN=:p1");
          if (expected.hasMiscBinaryFlags())
              update.append(" AND t.MBITS=:m1");
          if (expected.hasName())
              update.append(" AND t.INAME=:n1");
          if (expected.hasNextExecutionTime())
              update.append(" AND t.NEXTEXEC=:ne1");
          if (expected.hasOriginalSubmitTime())
              update.append(" AND t.ORIGSUBMT=:os1");
          if (expected.hasPreviousScheduledStartTime())
              update.append(" AND t.PREVSCHED=:sc1");
          if (expected.hasPreviousStartTime())
              update.append(" AND t.PREVSTART=:sa1");
          if (expected.hasPreviousStopTime())
              update.append(" AND t.PREVSTOP=:so1");
          if (expected.hasResult())
              update.append(" AND t.RESLT=:r1");
          if (expected.hasConsecutiveFailureCount())
              update.append(" AND t.RFAILS=:f1");
          if (expected.hasState())
              update.append(" AND t.STATES=:s1");
          if (expected.hasTask())
              update.append(" AND t.TASKB=:t1");
          if (expected.hasTaskInformation())
              update.append(" AND t.TASKINFO=:ti1");
          if (expected.hasTrigger())
              update.append(" AND t.TRIG=:tr1");
          if (expected.hasVersion())
              update.append(" AND t.VERSION=:v1");
  
          final boolean trace = TraceComponent.isAnyTracingEnabled();
          if (trace && tc.isEntryEnabled())
              Tr.entry(this, tc, "persist", updates, expected, update);
  
          EntityManager em = getPersistenceServiceUnit().createEntityManager();
          try {
              Query query = em.createQuery(update.toString());
  
              if (updates != null) {
                  if (updates.hasIdentifierOfClassLoader())
                      query.setParameter("c2", updates.getIdentifierOfClassLoader());
                  if (updates.hasIdentifierOfOwner())
                      query.setParameter("o2", updates.getIdentifierOfOwner());
                  if (updates.hasIdentifierOfPartition())
                      query.setParameter("p2", updates.getIdentifierOfPartition());
                  if (updates.hasMiscBinaryFlags())
                      query.setParameter("m2", updates.getMiscBinaryFlags());
                  if (updates.hasName())
                      query.setParameter("n2", updates.getName());
                  if (updates.hasNextExecutionTime())
                      query.setParameter("ne2", updates.getNextExecutionTime());
                  if (updates.hasOriginalSubmitTime())
                      query.setParameter("os2", updates.getOriginalSubmitTime());
                  if (updates.hasPreviousScheduledStartTime())
                      query.setParameter("sc2", updates.getPreviousScheduledStartTime());
                  if (updates.hasPreviousStartTime())
                      query.setParameter("sa2", updates.getPreviousStartTime());
                  if (updates.hasPreviousStopTime())
                      query.setParameter("so2", updates.getPreviousStopTime());
                  if (updates.hasResult())
                      query.setParameter("r2", updates.getResult());
                  if (updates.hasConsecutiveFailureCount())
                      query.setParameter("f2", updates.getConsecutiveFailureCount());
                  if (updates.hasState())
                      query.setParameter("s2", updates.getState());
                  if (updates.hasTask())
                      query.setParameter("t2", updates.getTask());
                  if (updates.hasTaskInformation())
                      query.setParameter("ti2", updates.getTaskInformation());
                  if (updates.hasTrigger())
                      query.setParameter("tr2", updates.getTrigger());
              }
  
              query.setParameter("i", expected.getId());
  
              if (expected.hasIdentifierOfClassLoader())
                  query.setParameter("c1", expected.getIdentifierOfClassLoader());
              if (expected.hasIdentifierOfOwner())
                  query.setParameter("o1", expected.getIdentifierOfOwner());
              if (expected.hasIdentifierOfPartition())
                  query.setParameter("p1", expected.getIdentifierOfPartition());
              if (expected.hasMiscBinaryFlags())
                  query.setParameter("m1", expected.getMiscBinaryFlags());
              if (expected.hasName())
                  query.setParameter("n1", expected.getName());
              if (expected.hasNextExecutionTime())
                  query.setParameter("ne1", expected.getNextExecutionTime());
              if (expected.hasOriginalSubmitTime())
                  query.setParameter("os1", expected.getOriginalSubmitTime());
              if (expected.hasPreviousScheduledStartTime())
                  query.setParameter("sc1", expected.getPreviousScheduledStartTime());
              if (expected.hasPreviousStartTime())
                  query.setParameter("sa1", expected.getPreviousStartTime());
              if (expected.hasPreviousStopTime())
                  query.setParameter("so1", expected.getPreviousStopTime());
              if (expected.hasResult())
                  query.setParameter("r1", expected.getResult());
              if (expected.hasConsecutiveFailureCount())
                  query.setParameter("f1", expected.getConsecutiveFailureCount());
              if (expected.hasState())
                  query.setParameter("s1", expected.getState());
              if (expected.hasTask())
                  query.setParameter("t1", expected.getTask());
              if (expected.hasTaskInformation())
                  query.setParameter("ti1", expected.getTaskInformation());
              if (expected.hasTrigger())
                  query.setParameter("tr1", expected.getTrigger());
              if (expected.hasVersion())
                  query.setParameter("v1", expected.getVersion());
  
              boolean updated = query.executeUpdate() > 0;
              if (trace && tc.isEntryEnabled())
                  Tr.exit(this, tc, "persist", updated);
              return updated;
          } finally {
              em.close();
          }
      }