Execute select statement and returns the all lines of rows corresponding
to the specified model class as array of Objects

@param modelClazz
@return
978826
public <T extends D6Model> T[] execSelectTable(Class<T> modelClazz) {

    final DBTable dbTable = modelClazz.getAnnotation(DBTable.class);
    final String dbTableName = dbTable.tableName();
    return (T[]) execSelectTable("SELECT * FROM " + dbTableName, modelClazz);
  }
52159
public static <T> T queryForObject(String sql, Class<T> clz, Object... args) {
		T result = null;
		List<T> list = queryForList(sql, clz, args);
		if (list.size() > 0) {
			result = list.get(0);
		}
		return result;
	}
599152
def select_models(clas,pool_or_cursor,**kwargs):
    ""
    if 'columns' in kwargs: raise ValueError("don't pass 'columns' to select_models")
    return (set_options(pool_or_cursor,clas(*row)) for row in clas.select(pool_or_cursor,**kwargs))
359118
public Object[] getRowData() throws SQLException {
        Object[] row = new Object[columnCount];
        for (int i = 1; i < columnCount + 1; i++) {
            row[i - 1] = getObject(i);
        }
        return row;
    }
453077
public <T> List<T> selectList(String sql, Object value, Class<T> resultType) {
        String msId;
        Class<?> parameterType = value != null ? value.getClass() : null;
        if (resultType == null) {
            msId = msUtils.selectDynamic(sql, parameterType);
        } else {
            msId = msUtils.selectDynamic(sql, parameterType, resultType);
        }
        return sqlSession.selectList(msId, value);
    }
925283
public static String getSelectCountSQL(Class<?> clazz) {
		StringBuilder sql = new StringBuilder();
		sql.append("SELECT count(*)");
		
		// 处理join方式clazz
		JoinTable joinTable = DOInfoReader.getJoinTable(clazz);
		if(joinTable != null) {
			Field leftTableField = DOInfoReader.getJoinLeftTable(clazz);
			Field rightTableField = DOInfoReader.getJoinRightTable(clazz);
			
			JoinLeftTable joinLeftTable = leftTableField.getAnnotation(JoinLeftTable.class);
			JoinRightTable joinRightTable = rightTableField.getAnnotation(JoinRightTable.class);
			
	        Table table1 = DOInfoReader.getTable(leftTableField.getType());
	        Table table2 = DOInfoReader.getTable(rightTableField.getType());
	        
	        sql.append(" FROM ").append(getTableName(table1))
	           .append(" ").append(joinLeftTable.alias()).append(" ");
	        sql.append(joinTable.joinType().getCode()).append(" ");
	        sql.append(getTableName(table2)).append(" ").append(joinRightTable.alias());
	        if(joinTable.on() == null || joinTable.on().trim().isEmpty()) {
	        	throw new OnConditionIsNeedException("join table VO:" + clazz.getName());
	        }
	        sql.append(" on ").append(joinTable.on().trim());
	        
		} else {
			Table table = DOInfoReader.getTable(clazz);
			sql.append(" FROM ").append(getTableName(table));
		}
		
		return sql.toString();
	}
907854
public List<T> getResults(Connection conn, DataObject object) throws Exception {
        return executeSelect(conn, object, new ResultSetMapper<ArrayListCollector<T>>(new ArrayListCollector<T>()));
    }
583325
static List<Field> getAllFieldsOfClass0(Class<?> clazz) {
        List<Field> fields = CollectionUtil.createArrayList();
        for (Class<?> itr = clazz; hasSuperClass(itr); ) {
            fields.addAll(Arrays.asList(itr.getDeclaredFields()));
            itr = itr.getSuperclass();
        }

        return fields;
    }
501527
public static Field[] getAllFields(Class<?> clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("You must specify the class that contains the fields");
        }
        Set<Field> fields = new LinkedHashSet<Field>();

        Class<?> thisType = clazz;

        while (thisType != null) {
            final Field[] declaredFields = thisType.getDeclaredFields();
            for (Field field : declaredFields) {
                field.setAccessible(true);
                fields.add(field);
            }
            thisType = thisType.getSuperclass();
        }
        return fields.toArray(new Field[fields.size()]);
    }
779957
@Override
    public final <E> List<E> findAll(Class<E> entityClass, String[] columnsToSelect, Object... rowIds) {
        // TODO: need to think about selected column case.
        // Bring in IN Clause in place of each read.

        List results = new ArrayList<E>();
        if (rowIds != null) {
            for (Object rowId : rowIds) {
                Object result = find(entityClass, rowId);
                if (result != null) {
                    results.add(result);
                }
            }
        }
        return results;
    }
696653
public List list(Class clazz, String key, Object value)
    {
        EntityManager entityManager = null;
        try {
            entityManager = entityManagers.poll();

            Query query = entityManager.createQuery("SELECT c FROM " + clazz.getCanonicalName() + " c where c." + key + " = :param");
            query.setParameter("param", value);
            return query.getResultList();

        } catch (Exception e) {
            e.printStackTrace();
        }
        finally {
            if(entityManager != null)
                entityManagers.add(entityManager);
        }

        return null;
    }
1298226
static List<List<String>> handleNewLines( List<List<String>> tableModel ) {
        List<List<String>> result = Lists.newArrayListWithExpectedSize( tableModel.size() );

        for( List<String> row : tableModel ) {
            if( hasNewline( row ) ) {
                result.addAll( splitRow( row ) );
            } else {
                result.add( row );
            }
        }

        return result;
    }
152854
private int getTotal(Class<?> clazz) {
        StringBuilder sql = new StringBuilder();
        sql.append(SQLUtils.getSelectCountSQL(clazz));
        sql.append(SQLUtils.autoSetSoftDeleted("", clazz));

        log(sql);
        long start = System.currentTimeMillis();
        int rows = jdbcTemplate.queryForObject(sql.toString(), Integer.class);

        long cost = System.currentTimeMillis() - start;
        logSlow(cost, sql.toString(), null);
        return rows;
    }
648281
def fetch_all_objects_from_db(self,
                                  cls: Type[T],
                                  table: str,
                                  fieldlist: Sequence[str],
                                  construct_with_pk: bool,
                                  *args) -> List[T]:
        """"""
        return self.fetch_all_objects_from_db_where(
            cls, table, fieldlist, construct_with_pk, None, *args)
372926
public static <T> List<T> listFromClause(Class<T> clazz, String clause, Object... args)
    {
       return SqlClosure.sqlExecute(c -> OrmElf.listFromClause(c, clazz, clause, args));
    }
876813
public @NotNull <T> List<T> findAll(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) {
        return findAll(cl, SqlQuery.query(sql, args));
    }
500434
public static List<Method> getAllDeclaredMethods(Class<?> clazz) {
		List<Method> result = new ArrayList<>();
		while (clazz != null) {
			Method[] methods = clazz.getDeclaredMethods();
			Collections.addAll(result, methods);
			clazz = clazz.getSuperclass();
		}
		return result;
	}