Saturday, September 16, 2006

some skate pics





Smithgrind at the Crib Ramp


frontside noseblunt slide at 3rd and Army

Sunday, September 10, 2006

immutable queries

I got some feedback (see previous blog entry comments) that prompted me to implement "immutable queries". These are queries in which the SQL is 100% specified by the user.

String expr = "SELECT FNAME AS FNAME FROM STUDENT";
Query q = QueryFactory.newImmutableQuery(expr);
RecordCandidate cand = q.candidate(dict.getORM("STUDENT"));
cand.setFetchColumns("FNAME");
List students = new ArrayList();
sess.executeQuery(connection,q).populateList(students, Student.class);
System.out.println(students);

Of course it is still parameterizable, like this:

String expr="SELECT FNAME AS FNAME FROM STUDENT WHERE "+
"LNAME LIKE ${lname}";
Query q = QueryFactory.newImmutableQuery(expr);
RecordCandidate cand = q.candidate(dict.getORM("STUDENT"));
cand.setFetchColumns("FNAME");
List students = new ArrayList();
sess.setParameter("lname", "smith");
sess.executeQuery(connection,q).populateList(students, Student.class);
System.out.println(students);

I'll update the Shades download sometime next week.

Wednesday, September 06, 2006

sourceforge project

I just created a project on sourceforge:
http://sourceforge.net/projects/shadesdb

check it out!