SQLTemplate doing something differently?

From: Eric Schneider (eri..entralparksoftware.com)
Date: Mon May 24 2004 - 11:53:14 EDT

  • Next message: Andrus Adamchik: "Re: SQLTemplate doing something differently?"

    Hi,

    During the process of upgrading to M8 I've switch all our SqlSelectQuery
    objects to SQLTemplate objects.

    Oddly, SqlSelectQueries that run perfectly throw errors as SQLTemplates. It
    seems to complain about a column that has nothing to do with the select
    call. "Null value for 'GAMENUMBER'."

    What is SQLTemplate doing differently here?

    Thanks,
    Eric

    net.sf.tapestry.RequestCycleException
    [v.1.1M6 April 25 2004] Null value for 'GAMENUMBER'. Snapshot:
    org.objectstyle.cayenne.DataRo..7b35d[version=-9223372036854775130,values={
    PERIOD3GOALS=9, OVERTIMEGOALS=1, PERIOD1GOALS=10, PERIOD2GOALS=9}]
    component:
    com.nhl.statscontract.pages.PlayerPowerInquir..277a30[PlayerPowerInquiry]

    org.objectstyle.cayenne.CayenneRuntimeException
    [v.1.1M6 April 25 2004] Null value for 'GAMENUMBER'. Snapshot:
    org.objectstyle.cayenne.DataRo..7b35d[version=-9223372036854775130,values={
    PERIOD3GOALS=9, OVERTIMEGOALS=1, PERIOD1GOALS=10, PERIOD2GOALS=9}]
    Stack Trace:
    org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:198)
    org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:173)
    org.objectstyle.cayenne.access.DataContext.objectsFromDataRows(DataContext.j
    ava:655)
    org.objectstyle.cayenne.access.util.SelectObserver$PrefetchTreeNode.resolveO
    bjectTree(SelectObserver.java:377)
    org.objectstyle.cayenne.access.util.SelectObserver.getResultsAsObjects(Selec
    tObserver.java:193)
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:127
    4)
    com.nhl.model.Goals.getGoalsByPeriodForPlayer(Goals.java:67)
    com.nhl.statscontract.components.PlayerGoalAnalysis.prepareForRender(PlayerG
    oalAnalysis.java:64)

    Last sql executed before error:

    Select p1g.PERIOD1GOALS, p2g.PERIOD2GOALS, p3g.PERIOD3GOALS,
    otg.OVERTIMEGOALS
    from (select count(*) as period1Goals from goals where season = 20022003 and
    gametype = 2
    and scoredBy = 8467351 and period = 1) p1g ,(select count(*) as period2Goals
    from goals where season = 20022003 and gametype = 2 and scoredBy = 8467351
    and period = 2) p2g ,
    (select count(*) as period3Goals from goals
    where season = 20022003 and gametype = 2 and scoredBy = 8467351 and period =
    3) p3g ,
    (select count(*) as overtimeGoals from goals where season = 20022003
    and gametype = 2 and scoredBy = 8467351 and period > 3) otg



    This archive was generated by hypermail 2.0.0 : Mon May 24 2004 - 11:53:14 EDT