code: public static String buildSelectSQL(BeanDescFactory beanDescFactory, EntityOperator entityOperator, Class<?> clazz, NameConverter nameConverter){
          StringBuilder sb = new StringBuilder();
          BeanDesc beanDesc = beanDescFactory.getBeanDesc(clazz);
  
          sb.append("SELECT * FROM ");
          sb.append(MirageUtil.getTableName(clazz, nameConverter));
          sb.append(" WHERE ");
  
          int count = 0;
  
          for(int i=0; i<beanDesc.getPropertyDescSize(); i++){
              PropertyDesc pd = beanDesc.getPropertyDesc(i);
              PrimaryKeyInfo primaryKey = entityOperator.getPrimaryKeyInfo(clazz, pd, nameConverter);
              if(primaryKey != null){
                  if(count != 0){
                      sb.append(" AND ");
                  }
                  sb.append(MirageUtil.getColumnName(entityOperator, clazz, pd, nameConverter));
                  sb.append(" = ?");
                  count++;
              }
          }
          if(count == 0){
              throw new RuntimeException(
                      "Primary key is not found: " + clazz.getName());
          }
  
          return sb.toString();
      }
docs: Builds select (by primary keys) SQL from the entity class.
  
  @param beanDescFactory the bean descriptor factory
  @param entityOperator the entity operator
  @param clazz the entity class to select
  @param nameConverter the name converter
  
  @return Select SQL
  
  @throws RuntimeException the entity class has no primary keys
  @deprecated use {@link #buildSelectSQL(String, BeanDescFactory, EntityOperator, Class, NameConverter)} instead