db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subadhra Jagannathan" <subadhra.jagannat...@gmail.com>
Subject Uppercase column names throwing a null pointer access in addAscendingOrderByColumn()
Date Thu, 27 Mar 2008 23:24:39 GMT
Hello all,

I hope someone can help me/point me to what I am doing wrong.

If do these query in mySQL query browser --

select person.PERSON_ID from person where person.PERSON_ID > 100
order by person.PERSON_ID asc;

select person.person_id from person where person.person_id > 100
order by person.person_id asc;

both works, so I know my sql is not case sensitive on column names.

But if I use criteria, among the following functions (below),
testCrit() and testCrit1() both works fine, but the testCrit2() with the
uppercase col name in the addAscendingOrderByColumn() fails with the null
pointer exception.

This was working in Torque 3.2. Can some one point me what is it that I am
doing wrong?

Thanks a lot.
Subadhra


public void testCrit() throws Exception {
        Criteria crit = new Criteria();
        crit.addSelectColumn(PersonPeer.PERSON_ID);
        crit.add(PersonPeer.PERSON_ID, 100, Criteria.GREATER_THAN);
        crit.addAscendingOrderByColumn(PersonPeer.PERSON_ID);
        List list = BasePeer.doSelect(crit);
        System.out.println(list.size());
    }

    public void testCrit1() throws Exception {
        Criteria crit = new Criteria();
        crit.addSelectColumn("person.person_id");
        crit.add("person.person_id", 100, Criteria.GREATER_THAN);
        crit.addAscendingOrderByColumn("person.person_id");
        List list = BasePeer.doSelect(crit);
        System.out.println(list.size());
    }

    public void testCrit2() throws Exception {
        Criteria crit = new Criteria();
        crit.addSelectColumn("person.person_id");
        crit.add("person.person_id", 100, Criteria.GREATER_THAN);
        crit.addAscendingOrderByColumn("person.PERSON_ID");
        List list = BasePeer.doSelect(crit);
        System.out.println(list.size());
    }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message