private void writeList() {
        String mapperName = table.getDomName() + "Dao";

        for ( Column column : table.getColumns() ) {
            if ( column.isSearchId() ) {
                // do this to make sure the created method is properly
                // camelCased
                String fieldName = column.getFldName();
                fieldName = toTitleCase( fieldName );

                write( TAB );
                write( "public " );
                write( "List<" + table.getDomName() + "> getListBy" );
                write( fieldName );
                write( "( " );
                write( column.getFldType() );
                write( " key ) throws BoException {\n" );

                write( TAB + TAB + "SqlSession session = null;\n" );
                write( TAB + TAB + "List<" + table.getDomName() + "> list;\n\n" );

                write( TAB + TAB + "try {\n" );
                write( TAB + TAB + TAB + "session = SessionFactory.getSession();\n" );

                write( TAB + TAB + TAB + mapperName );
                write( " mapper = session.getMapper( " + mapperName + ".class );\n" );
                write( TAB + TAB + TAB + "list = mapper." );
                write( "getListBy" );
                write( fieldName );
                write( "( key );\n" );
                write( TAB + TAB + TAB + "session.commit();\n\n" );

                write( TAB + TAB + "} catch ( Exception e ) {\n" );
                write( TAB + TAB + TAB + "session.rollback();\n" );
                write( TAB + TAB + TAB + "throw new BoException( e );\n\n" );

                write( TAB + TAB + "} finally { \n" );
                write( TAB + TAB + TAB + "if ( session != null )\n" );
                write( TAB + TAB + TAB + TAB + "session.close();\n" );
                write( TAB + TAB + "}\n\n" );
                write( TAB + TAB + "return list;\n" );
                write( TAB + "}\n\n" );
            }
        }
    }