From: Daan G. <daa...@gm...> - 2007-11-21 21:25:10
|
I will try to answer both your mails in this one. Maybe it's time to explain the origin of the 3.0 release. I think it will answer a lot of questions. As a student in my senior year, I took sql2java for a spin during my last term internship. I had to make some changes to it, but ended up re-designing and re-creating the whole application. The company where I was doing the internship was also investigating IBatis and Spring. Therefor I thought it would be nice to add support for these technologies to the project. But there was a problem. While adding support for Spring and IBatis, I kind of 'broke' the regular JDBC support as well as almost every template originally written for sql2java (due to different parameters used inside the templates). Instead of fixing this, I was too focussed on implementing the new features like scripting and template packs, resulting in a major gap in the template support. Finally convinced of my mistake, We (Kristof and me) started to modify the legacy sql2java templates so they can be used inside the 3.0 release. This might seem not so difficult, but it's taking a lot of time. -- So far the history part. To answer your questions: ---------------------------------------------------------------- Another question, looking in one of the files (QueryDefenition.java from package net.sf.sql2java.dal it says:- * To change this template, choose Tools | Template Manager * and open the template in the editor. */ Which, which program it is talking about? ---------------------------------------------------------------- This is actually due to my bad setup of netbeans. It prints a header onto every java file I create. Sorry for the confusion. ---------------------------------------------------------------- I have noticed all manner of stuff with references to Swing around in this project, but I have yet to find a main() that invokes any of it. ---------------------------------------------------------------- Well Alain and I both started creating some sort of GUI, He did it using plain java, I did it using netbeans wonderful GUI editor. You may try this allthough it won't help you much. An effort has been started to create an eclipse plugin, so it would be a lot easier to create templates, manage packs, configure the project, ... The code Alain and I wrote will be isolated and put inside another source folder. ---------------------------------------------------------------- Firstly, I keep using this list of people to send questions to, because there does not seem to be (or if there is I have not spotted it) a developers mailing list. If there is one can someone point me to is, and if there is not would it not be a good idea to have one - and no, a forum is in my view useless in this respect. ---------------------------------------------------------------- There is a mailinglist for developers which can be used for this purpose. Maybe it's also usefull to display a short list of all mailinglist, so everyone knows what to expect. - sql2java-cvs Holds CVS updates. I don't have the password for this list, so I'm unable to administer this. - sql2java-develop The list we should use to post this discussions, as well as others regarding the development of the project onto. - sql2java-eclipse Everything regarding the 'new' eclipse plugin - sql2java-users discussions for the users of the project. ---------------------------------------------------------------- Secondly we seem to have lost the ...Manager classes (I have no problem with this), but we also seem to have lost the Manager class which actually talks to the DB - at least in the common and java5 templates. Has anyone sketched out what this should look like for this time around. ---------------------------------------------------------------- This is a result of me being to stupid to create descent support for plain JDBC. I used Spring to hold all of my database configuration and to handle transactions. The manager classes will return once we have converted the legacy templates. ---------------------------------------------------------------- Finally (for this email) I notice in the dal directory that we still seem to be building strings with direct values in them. This means all manner of complication to avoid things like sql injection attacks and to do escaping correctly. I have offered before, and offer again, a class that I am using in my accounting package which keeps the SQL clauses and their parameters separate but organised, and then provides a means to build proper PreparedStatements with value substitution. It would require a little work to add into it the kind of subclass of ConditionParameter, but could be done. ---------------------------------------------------------------- It seems a very good idea to add your class to the utilities. sql injection attacks could indeed be a problem, although only for certain technologies. I think hibernate, Ibatis as well as others hold some sort of protection against this. But you are right, it is mandatory. As you have noticed reading this email, I made the mistake focussing the project to only a few technologies (IBatis, Spring). Then there is the problem of template dependencies. Imagine the IBatis/Spring example. This would imply using Spring based IBatis mappings, so Spring templates especially for IBatis. When changing the ORM technology, we also need to modify the templates inside the Spring pack. I'm still searching for a descent way to solve this issue. Ideas are always welcome. Daan Op woensdag 21-11-2007 om 15:03 uur [tijdzone +0000], schreef David Goodenough: > On Tuesday 20 November 2007, FAGOT Alain wrote: > > Hi, > > > > Due to the fact the DatabaseMetaData.getIndexInfo() method is returning > > info as well for the indices as for the keys, I suppose both the problems > > you are struggling with may be solved by an integrated approach. > > > > I can only encourage you to exchange your points of view about the issue. > > I keep clear in mind that "nfdavenport" is currently trying to make it work > > in the 2.6 line (mainly indexes), while "dfgdga" would like it to work > > correctly in the 3.0 line (mainly keys). Anyway, I hope that what is good > > design for one, can also be applied by the other. > > > > Many thanks for both your efforts to make a better sql2java, > > Another question, looking in one of the files (QueryDefenition.java from > package net.sf.sql2java.dal it says:- > > * To change this template, choose Tools | Template Manager > * and open the template in the editor. > */ > > Which, which program it is talking about? I have noticed all manner of > stuff with references to Swing around in this project, but I have yet > to find a main() that invokes any of it. > > David |