docs: @Override
      public List<PartitionRecord> find(PartitionRecord expected) throws Exception {
          StringBuilder select = new StringBuilder(172).append("SELECT p.EXECUTOR,p.HOSTNAME,p.ID,p.LSERVER,p.USERDIR FROM Partition p");
          if (expected != null) {
              select.append(" WHERE");
              if (expected.hasExecutor())
                  select.append(" p.EXECUTOR=:x AND");
              if (expected.hasHostName())
                  select.append(" p.HOSTNAME=:h AND");
              if (expected.hasId())
                  select.append(" p.ID=:i AND");
              if (expected.hasLibertyServer())
                  select.append(" p.LSERVER=:l AND");
              if (expected.hasUserDir())
                  select.append(" p.USERDIR=:u AND");
              int length = select.length();
              select.delete(length - (select.charAt(length - 1) == 'E' ? 6 : 3), length);
          }
          select.append(" ORDER BY p.ID ASC");
  
          final boolean trace = TraceComponent.isAnyTracingEnabled();
          if (trace && tc.isEntryEnabled())
              Tr.entry(this, tc, "find", expected, select);
  
          List<PartitionRecord> records = new ArrayList<PartitionRecord>();
          EntityManager em = getPersistenceServiceUnit().createEntityManager();
          try {
              TypedQuery<Object[]> query = em.createQuery(select.toString(), Object[].class);
              if (expected != null) {
                  if (expected.hasExecutor())
                      query.setParameter("x", expected.getExecutor());
                  if (expected.hasHostName())
                      query.setParameter("h", expected.getHostName());
                  if (expected.hasId())
                      query.setParameter("i", expected.getId());
                  if (expected.hasLibertyServer())
                      query.setParameter("l", expected.getLibertyServer());
                  if (expected.hasUserDir())
                      query.setParameter("u", expected.getUserDir());
              }
  
              List<Object[]> results = query.getResultList();
              for (Object[] result : results) {
                  PartitionRecord record = new PartitionRecord(true);
                  record.setExecutor((String) result[0]);
                  record.setHostName((String) result[1]);
                  record.setId((Long) result[2]);
                  record.setLibertyServer((String) result[3]);
                  record.setUserDir((String) result[4]);
                  records.add(record);
              }
          } finally {
              em.close();
          }
  
          if (trace && tc.isEntryEnabled())
              Tr.exit(this, tc, "find", records.size() < 20 ? records : records.size());
          return records;
      }