Database Operation usage of HIbernate

Which method of HIbernate is more appropriate to use in the SQL statement

select name,sex from db, for example:
public T findByID (ID id, I dbName) throws Exception;

public List<T> findAll(I dbName) throws Exception;

public List<T> findByExample(T exampleInstance, I dbName,
        String... excludeProperties) throws Exception;

public List<T> findByExample(T exampleInstance, I dbName) throws Exception;

public List<T> findByCriteria(I dbName, Criterion... criterions) throws Exception;

public List<T> findByCriteria(I dbName, List<Criterion> criterions) throws Exception;

public List<T> findByCriteria(I dbName, List<Criterion> criterions,
        List<Order> orders) throws Exception;

public List<T> findByCriteriaAndLimtSize(I dbName, int size,
        Criterion... criterions) throws Exception;

public List<T> findByCriteriaByPage(I dbName, int offsetFrom, int size,
        List<Criterion> criterions, List<Order> orders) throws Exception;
The query for

hibernate is done with the query object, that is, Query query=session.createQuery (sql), traverses the query or converts it directly to list.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be5f9c-30506.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be5f9c-30506.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?