RE: DB Module Problem
"Anthony Eden" <[email protected]>
| Newsgroups | gmane.comp.java.jpublish.devel |
|---|---|
| Message-ID | <000d01c265a1$db6f26f0$01000001@mobile1> |
Chris, I have updated the index.xml file in the CVS, thanks. The reason for the <multiple> element is to determine whether or not a collection or a single object should be exposed in the context. I could just always return a collection, even if there is one element, but I thought it would be nice to say something like this (from the edit page): <page-action name="db.query"> <connection-name>localhost</connection-name> <context-name>contact</context-name> <select> <sql>select * from contact where name = ?</sql> <param index="1" name="name"/> </select> </page-action> And have the DBModule automatically place the single result directly in the context under the name contact, as opposed to having to extract the contact from a collection even if you know you should only have one contact. Am I off-base here? Other than the minor bugs what do you think of the concept? Will this make it easier to write simple DB-backed applications? Sincerely, Anthony Eden > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On > Behalf Of Chris Davis > Sent: Wednesday, September 25, 2002 1:57 PM > To: [email protected] > Subject: [JPublish-developer] DB Module Problem > > > Hello, > > I have been taking a look at the DB Module, and tried to test > out the sample application that is packaged with the module. > > Initially I was having some trouble getting the expected > output on the index.html page. However, after some digging > through the source, I found that the <select> element > supports a sub element <multiple>. > > Once I changed the index.xml to include the following: > > <select> > <multiple>yes</multiple> > <sql>select * from contact</sql> > </select> > > I started getting the correct output. > > > For others that might com across this problem, the > QueryAction.java source defaults to (multiple is false) and > will set (multiple is true) if it finds a <multiple> element > with any non null value, (the value does not have to be "yes"). > > As a suggestion (my 2 cents worth) for a future change, it > might be better to use something like: > > <sql rows="[numberOfRows]"> > > where all rows are returned by default and x number if rows= > has been defined. > > > Bye, > Chris > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Jpublish-developer mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jpublish-developer > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf