Package org.apache.torque.om.mapper

Examples of org.apache.torque.om.mapper.ObjectListMapper


        {
            result = BasePeer.doSelect(
                    "SELECT book.* FROM book "
                        + "INNER JOIN author "
                        + "ON book.AUTHOR_ID=author.AUTHOR_ID",
                    new ObjectListMapper(),
                    (String) null);
        }
        catch (Exception e)
        {
            e.printStackTrace();
            fail("Explicit SQL query 1 : Exception caught : "
                     + e.getClass().getName()
                     + " : " + e.getMessage());
        }

        assertTrue(
            "Explicit SQL query 1 : size of result is not 3, but"
            + result.size(),
            result.size() == 3);

        result = null;
        try
        {
            result = BasePeer.doSelect(
                    "SELECT book.* FROM book,author "
                        + "WHERE book.AUTHOR_ID=author.AUTHOR_ID",
                    new ObjectListMapper(),
                    (String) null);
        }
        catch (Exception e)
        {
            e.printStackTrace();
View Full Code Here


            throws TorqueException
    {
        Criteria c = buildCriteria(crit);
        // TODO use BasePeerImpl.doSelect instead of parsing the result manually
        String query = SqlBuilder.buildQuery(c).toString();
        RecordMapper<List<Object>> mapper = new ObjectListMapper(resultTypes);

        Statement statement = null;
        ResultSet resultSet = null;
        List<List<Object>> rows = new ArrayList<List<Object>>();
        try
        {
            statement = conn.createStatement();
            long startTime = System.currentTimeMillis();
            logger.debug("Executing query " + query);

            resultSet = statement.executeQuery(query.toString());
            long queryEndTime = System.currentTimeMillis();
            logger.trace("query took " + (queryEndTime - startTime)
                    + " milliseconds");

            while (resultSet.next())
            {
                List<Object> rowResult = mapper.processRow(resultSet, 0, null);
                rows.add(rowResult);
            }
            long mappingEndTime = System.currentTimeMillis();
            logger.trace("mapping took " + (mappingEndTime - queryEndTime)
                    + " milliseconds");
View Full Code Here

            throws TorqueException
    {
        org.apache.torque.criteria.Criteria c = buildCriteria(crit);
        // TODO use BasePeerImpl.doSelect instead of parsing the result manually
        String query = SqlBuilder.buildQuery(c).toString();
        RecordMapper<List<Object>> mapper = new ObjectListMapper(resultTypes);

        Statement statement = null;
        ResultSet resultSet = null;
        List<List<Object>> rows = new ArrayList<List<Object>>();
        try
        {
            statement = conn.createStatement();
            long startTime = System.currentTimeMillis();
            logger.debug("Executing query " + query);

            resultSet = statement.executeQuery(query.toString());
            long queryEndTime = System.currentTimeMillis();
            logger.trace("query took " + (queryEndTime - startTime)
                    + " milliseconds");

            while (resultSet.next())
            {
                List<Object> rowResult = mapper.processRow(resultSet, 0, null);
                rows.add(rowResult);
            }
            long mappingEndTime = System.currentTimeMillis();
            logger.trace("mapping took " + (mappingEndTime - queryEndTime)
                    + " milliseconds");
View Full Code Here

TOP

Related Classes of org.apache.torque.om.mapper.ObjectListMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.