code: public boolean delete() {
  
          fireBeforeDelete();
          int result;
          if (getCompositeKeys() != null) {
              String[] compositeKeys = getCompositeKeys();
              StringBuilder query = new StringBuilder();
              Object[] values = new Object[compositeKeys.length];
              for (int i = 0; i < compositeKeys.length; i++) {
                  query.append(i == 0 ? "DELETE FROM " + metaModelLocal.getTableName() + " WHERE " : " AND ").append(compositeKeys[i]).append(" = ?");
                  values[i] = get(compositeKeys[i]);
              }
              result = new DB(metaModelLocal.getDbName()).exec(query.toString(), values);
          } else {
              StringBuilder query = new StringBuilder("DELETE FROM ").append(metaModelLocal.getTableName()).append(" WHERE ").append(getIdName()).append("        = ?");
              List<Object> values = new ArrayList<>();
              values.add(getId());
  
              if(metaModelLocal.hasPartitionIDs()){
                  for (String partitionId : metaModelLocal.getPartitionIDs()) {
                      query.append(" AND ").append(partitionId).append(" = ?");
                      values.add(get(partitionId));
                  }
              }
  
  
              result = new DB(metaModelLocal.getDbName()).exec(query.toString(), values.toArray());
          }
          if (1 == result) {
              frozen = true;
              if (metaModelOf(getClass()).cached()) {
                  Registry.cacheManager().purgeTableCache(metaModelLocal);
              }
              ModelDelegate.purgeEdges(metaModelLocal);
              fireAfterDelete();
              return true;
          }
          fireAfterDelete();
          return false;
      }
docs: Deletes a single table record represented by this instance. This method assumes that a corresponding table
  has only one record whose PK is the ID of this instance.
  After deletion, this instance becomes {@link #frozen()} and cannot be used anymore until {@link #thaw()} is called.
  
  @return true if a record was deleted, false if not.