src/org/nutz/dao/util/Daos.java
public static <T> List<T> queryWithLinks(final Dao dao,
                                             final Class<T> classOfT,
                                             final Condition cnd,
                                             final Pager pager,
                                             final String regex) {
        Molecule<List<T>> molecule = new Molecule<List<T>>() {
            public void run() {
                List<T> list = dao.query(classOfT, cnd, pager);
                dao.fetchLinks(list, regex);
                setObj(list);
            }
        };
        return Trans.exec(molecule);
    }
public static <T> List<T> queryWithLinks(final Dao dao,
                                             final Class<T> classOfT,
                                             final Condition cnd,
                                             final Pager pager,
                                             final String regex) {
        Molecule<List<T>> molecule = new Molecule<List<T>>() {
            public void run() {
                List<T> list = dao.query(classOfT, cnd, pager);
                dao.fetchLinks(list, regex);
                setObj(list);
            }
        };
        return Trans.exec(molecule);
    }
public static < T > List < T > queryWithLinks ( final Dao dao , final Class < T > classOfT , final Condition cnd , final Pager pager , final String regex ) { Molecule < List < T >> molecule = new Molecule < List < T > > ( ) { public void run ( ) { List < T > list = dao . query ( classOfT , cnd , pager ) ; dao . fetchLinks ( list , regex ) ; setObj ( list ) ; } } ; return Trans . exec ( molecule ) ; }
在同一个事务内查询对象及关联对象

@param dao
Dao实例
@param classOfT
指定的Pojo类
@param cnd
查询条件
@param pager
分页语句
@param regex
需要查出的关联对象, 可以参阅dao.fetchLinks
@return 查询结果
在同一个事务内查询对象及关联对象