|
From: Thomas R. <tri...@tr...> - 2003-05-04 17:39:38
|
Isabelle,
I think you have a good start, but I have a few suggestions. Why not
start with the high level interfaces first, and then dig deeper into the
framework when we need to explain the more intricate features in more
detail. I would start with the ManualExtractionSqlQuery and SqlUpdate
classes.
Speaking of the ManualExtractionSqlQuery -- is there any chance that we
could rename this class to maybe MappingSqlQuery or something similar?
The current name makes it sound like there is a lot of manual work
involved in extracting some data from the database. In reality, it is
an elegant way of mapping your row data to Java classes, and I think the
name should reflect this. If we also renamed the extract() to mapRow(),
then that would in my mind make everything much clearer. Any thoughts
on this?
Here is an exmple of what the Query would look like:
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;
import com.interface21.jdbc.object.MappingSqlQuery;
import com.interface21.jdbc.core.SqlParameter;
/**
* @author trisberg
*/
public class SpringEmployeeQuery extends MappingSqlQuery {
public SpringEmployeeQuery(DataSource ds) {
super(ds, "select EMPNO, ENAME, HIREDATE from EMP where EMPNO = ?");
declareParameter(new SqlParameter(java.sql.Types.NUMERIC));
compile();
}
protected Object mapRow(ResultSet rs, int rownum) throws SQLException {
Employee emp = new Employee();
emp.setEmployeeId(rs.getInt("EMPNO"));
emp.setName(rs.getString("ENAME"));
emp.setHireDate(rs.getDate("HIREDATE"));
return emp;
}
}
Usage looks the same as before:
int employeeId = 7788;
SpringEmployeeQuery seq = new SpringEmployeeQuery(ds);
java.util.List empList = seq.execute(employeeId);
if (empList.iterator().hasNext()) {
Employee emp = (Employee) empList.iterator().next();
System.out.println(emp.getEmployeeId() + " " +
emp.getName() + " " +
emp.getHireDate().toString());
}
One additional thought. We currently require an explicit .compile() on
all queries and update statements. Could we not compile the sql behind
the scenes instead of throwing an exception. That would be more user
friendly and I can't see any disadvantage to this. What do you think?
Thomas
> Hi everyone,
>
> I've put the first part of the tutorial on the download section of my
website (www.meta-logix.com). I still need to incorporate the UML
diagrams, so it's a work in progress.
>
> Isabelle
>
> --
> Isabelle Muszynski
> Software Engineer
> Zandweellaan 4
> 2660 Antwerpen
> Belgium
> Tel. 32-(0)3-830 18 54
> Mobile: 32-(0)485 49 50 89
> Email: isa...@me...
> Website: www.meta-logix.com
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
--
Thomas Risberg
tri...@tr...
|
|
From: Brett B. <br...@po...> - 2003-05-05 08:50:54
|
Hi Isabelle, I have downloaded the tutorial but Acrobat 5 reports that the file is damaged so I can't read it's contents. Has anyone else reported this problem? Cheers Brett |
|
From: Isabelle M. <isa...@me...> - 2003-05-05 09:41:20
|
Hi Brett, No, no one else has reported the problem. And I got some comments form some people on the tutorial, so they obviously managed to oepn the file. Could you try downloading it again? Isabelle On Mon, May 05, 2003 at 09:50:51AM +0100, Brett Bell wrote: > Hi Isabelle, > > I have downloaded the tutorial but Acrobat 5 reports that the file is > damaged so I can't read it's contents. Has anyone else reported this > problem? > > Cheers > > Brett > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > -- Isabelle Muszynski Software Engineer Zandweellaan 4 2660 Antwerpen Belgium Tel. 32-(0)3-830 18 54 Mobile: 32-(0)485 49 50 89 Email: isa...@me... Website: www.meta-logix.com |
|
From: Isabelle M. <isa...@me...> - 2003-05-05 10:15:48
|
Hi Chris, The tutorial is currently availble via the download section of my web site (www.meta-logix.com). I post a new version whenever another section is done, so you do get it while I'm working on it. The code samples are available, but the problem is that we need to decide where to put them. I'd prefer to be able to post them in the download section at sourceforge. However, until that gets cleared up, I'll post them on my website. I'll do that tonight. Isabelle On Mon, May 05, 2003 at 10:55:57AM +0100, Chris Smith wrote: > Hi Isabelle, > > I know you're in the middle of writing it, but is the tutorial available > for general consumption whilst you're working on it? I can't find a url > for it anywhere. > > Also, there was mention of a wiki in a previous post. Did that get set up? > > And the samples, are they available anywhere? > > Sorry for all the questions, but I feel like I'm sooo missing out on > things :-) > > Regards, > Chris > > Isabelle Muszynski wrote: > > >Hi Brett, > > > >No, no one else has reported the problem. And I got some comments form > >some people on the tutorial, so they obviously managed to oepn the file. > >Could you try downloading it again? > > > >Isabelle > > > >On Mon, May 05, 2003 at 09:50:51AM +0100, Brett Bell wrote: > > > > > >>Hi Isabelle, > >> > >>I have downloaded the tutorial but Acrobat 5 reports that the file is > >>damaged so I can't read it's contents. Has anyone else reported this > >>problem? > >> > >>Cheers > >> > >>Brett > >> > >> > >> > >> > >>------------------------------------------------------- > >>This sf.net email is sponsored by:ThinkGeek > >>Welcome to geek heaven. > >>http://thinkgeek.com/sf > >>_______________________________________________ > >>Springframework-developer mailing list > >>Spr...@li... > >>https://lists.sourceforge.net/lists/listinfo/springframework-developer > >> > >> > >> > >> > > > > > > > > > -- Isabelle Muszynski Software Engineer Zandweellaan 4 2660 Antwerpen Belgium Tel. 32-(0)3-830 18 54 Mobile: 32-(0)485 49 50 89 Email: isa...@me... Website: www.meta-logix.com |
|
From: Isabelle M. <isa...@me...> - 2003-05-05 10:50:09
|
Hi Chris, I've put the java files on my website, in the downloads section. Isabelle On Mon, May 05, 2003 at 10:55:57AM +0100, Chris Smith wrote: > Hi Isabelle, > > I know you're in the middle of writing it, but is the tutorial available > for general consumption whilst you're working on it? I can't find a url > for it anywhere. > > Also, there was mention of a wiki in a previous post. Did that get set up? > > And the samples, are they available anywhere? > > Sorry for all the questions, but I feel like I'm sooo missing out on > things :-) > > Regards, > Chris > > Isabelle Muszynski wrote: > > >Hi Brett, > > > >No, no one else has reported the problem. And I got some comments form > >some people on the tutorial, so they obviously managed to oepn the file. > >Could you try downloading it again? > > > >Isabelle > > > >On Mon, May 05, 2003 at 09:50:51AM +0100, Brett Bell wrote: > > > > > >>Hi Isabelle, > >> > >>I have downloaded the tutorial but Acrobat 5 reports that the file is > >>damaged so I can't read it's contents. Has anyone else reported this > >>problem? > >> > >>Cheers > >> > >>Brett > >> > >> > >> > >> > >>------------------------------------------------------- > >>This sf.net email is sponsored by:ThinkGeek > >>Welcome to geek heaven. > >>http://thinkgeek.com/sf > >>_______________________________________________ > >>Springframework-developer mailing list > >>Spr...@li... > >>https://lists.sourceforge.net/lists/listinfo/springframework-developer > >> > >> > >> > >> > > > > > > > > > -- Isabelle Muszynski Software Engineer Zandweellaan 4 2660 Antwerpen Belgium Tel. 32-(0)3-830 18 54 Mobile: 32-(0)485 49 50 89 Email: isa...@me... Website: www.meta-logix.com |