Hello,
I made some changes in the original xManagerTemplate.vm from v.2.6.1
I added some JDK 1.5 features, as well I duplicated all methods that return array of Bean object with methods that return List of Bean object ...
this is a good addition to the project !
would recommand to create a subclass of the manager and add the list<$beanClass> in it.
--> we will be able to easily choose to generate it or not depending on our jdk.
Please submit your patch again to be included in the next version of sql2java :)
Florent.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I thought about your idea (to create a subclass of the manager) ...
I think that is not a cleanly way. In the original template you use ArrayList and in it you add decoded rows of the table,
and in the end of method - you converted ArrayList to array of objects ( ($beanClass[])v.toArray(new $beanClass[0]); )
If I extend manager with subclass I shall make a List<$beanClass> from array( $beanClass[] from super class method)
and I must be store in theList<$beanClass> - object per object from $beanClass[]-array ... that is not good, the second cycle is unnecessary.
In the my changes, I create in the first - List<$beanClass> and after that $beanClass[]-array and I used only one cycle for that.
I will tell you, how I use my new template and original - together :
I named the new template .... xManagerTemplate_1_5.vm
When I want to use 1.5 features I change row in sql2java.properties from :
mgrwriter.templates.pertable=xBeanTemplate.vm, xManagerTemplate.vm, xComparatorTemplate.vm, xListenerTemplate.vm
to
mgrwriter.templates.pertable=xBeanTemplate.vm, xManagerTemplate_1_5.vm, xComparatorTemplate.vm, xListenerTemplate.vm
and
mgrwriter.templates.loadingpath=......./s2j_templates
and generate with new template ... without changes in the sql2java-code :-)
I think that in the next release you can include the template ... and users can use this or other, only as make changes in the configuration file.
Please tell me, do you think about that !
Greetings
G.Dimitrov
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am pretty interested in your addition, however the sql2java version in cvs has evolved, and the way you switch between jdk1.5 & jdk1.4 is not valid anymore.
Could you checkout the cvs code, and give me ideas to switch elegantly from both jdks ?
enjoy your day,
Florent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was very surprised ... from existence of version 2.6.2 ... and most changes in it.
I don't see information about it in the Home page of project as in the SF project page. I learnt about it from Readme file in the CVS repository.
Now I checkout current code from CVS and I'll try to understand a changes after v2.6.2.
Greetings
G.Dimitrov
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
as there is lots of modifications in the new version, we do not want it to be public yet, it is still under developpment ...
we are very much interrested in your opinion, remarks, we are especially in need of the bad ones :)
Florent.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get the last version from CVS and I take a look at current code, and I think that templates for jdk1.4 & jdk 1.5, can switch from configuration file ... through configuration options (I made a test with following options):
, but the template that I changed – can't be used in v2.6.2 – directly, must be changed current template : “template.java.vm”, “bean.java.vm” and in the next - may be “comparator.java.vm”, as I tell you only for “core” classes without other classes for example ...factory..., ...web..., ...widget..., ...servlet... and others.
I don't know, when I'll have a free time to change current templates with jdk 1.5 features, but I try to make that during this week.
In the first time, I see implementation of “Manager.java” class in the last code, you are added Constructor that always loaded configuration for JDBC connection from a property file. When I don't want to use property file for configuration and I don't created it (for ex. I want to use DataSource and I set it directly in Manager), I 'll receive a Exception and error-message in a console when . The property file that I don't use, will be dirty project's class path. Do you think about that ?
Greetings
G.Dimitrov
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I successfuly make needs changes in templates(from CVS from Monday) for JDK 1.5 support :-).
You can see them in http://z-builder.dir.bg/_files/36120.7z
, also and my test config file.
But, I don't tested them very good :|
Please, tell me do you think about think?
Greetings,
G.Dimitrov
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I made some changes in the original xManagerTemplate.vm from v.2.6.1
I added some JDK 1.5 features, as well I duplicated all methods that return array of Bean object with methods that return List of Bean object ...
You can see my changes in http://z-builder.dir.bg/_files/32914.vm
I will be happy to see yours comments about that .
Greetings
G.Dimitrov
Hi,
this is a good addition to the project !
would recommand to create a subclass of the manager and add the list<$beanClass> in it.
--> we will be able to easily choose to generate it or not depending on our jdk.
Please submit your patch again to be included in the next version of sql2java :)
Florent.
Hello Florent,
I thought about your idea (to create a subclass of the manager) ...
I think that is not a cleanly way. In the original template you use ArrayList and in it you add decoded rows of the table,
and in the end of method - you converted ArrayList to array of objects ( ($beanClass[])v.toArray(new $beanClass[0]); )
If I extend manager with subclass I shall make a List<$beanClass> from array( $beanClass[] from super class method)
and I must be store in theList<$beanClass> - object per object from $beanClass[]-array ... that is not good, the second cycle is unnecessary.
In the my changes, I create in the first - List<$beanClass> and after that $beanClass[]-array and I used only one cycle for that.
I will tell you, how I use my new template and original - together :
I named the new template .... xManagerTemplate_1_5.vm
When I want to use 1.5 features I change row in sql2java.properties from :
mgrwriter.templates.pertable=xBeanTemplate.vm, xManagerTemplate.vm, xComparatorTemplate.vm, xListenerTemplate.vm
to
mgrwriter.templates.pertable=xBeanTemplate.vm, xManagerTemplate_1_5.vm, xComparatorTemplate.vm, xListenerTemplate.vm
and
mgrwriter.templates.loadingpath=......./s2j_templates
and generate with new template ... without changes in the sql2java-code :-)
I think that in the next release you can include the template ... and users can use this or other, only as make changes in the configuration file.
Please tell me, do you think about that !
Greetings
G.Dimitrov
Hi,
I am pretty interested in your addition, however the sql2java version in cvs has evolved, and the way you switch between jdk1.5 & jdk1.4 is not valid anymore.
Could you checkout the cvs code, and give me ideas to switch elegantly from both jdks ?
enjoy your day,
Florent
Hello Florent,
I was very surprised ... from existence of version 2.6.2 ... and most changes in it.
I don't see information about it in the Home page of project as in the SF project page. I learnt about it from Readme file in the CVS repository.
Now I checkout current code from CVS and I'll try to understand a changes after v2.6.2.
Greetings
G.Dimitrov
Hi,
as there is lots of modifications in the new version, we do not want it to be public yet, it is still under developpment ...
we are very much interrested in your opinion, remarks, we are especially in need of the bad ones :)
Florent.
Hello Florent,
I get the last version from CVS and I take a look at current code, and I think that templates for jdk1.4 & jdk 1.5, can switch from configuration file ... through configuration options (I made a test with following options):
template.file.exclude=manager.java.vm
template.file.include=bean.java.vm,comparator.java.vm,manager_1_5.java.vm,listener.java.vm,generated.bean.java.vm,dao.exception.java.vm,object.retrieval.exception.java.vm,data.access.exception.java.vm,data.retrieval.exception.java.vm
template.folder.exclude=hibernate,web,widget,servlet
template.folder.include=
, but the template that I changed – can't be used in v2.6.2 – directly, must be changed current template : “template.java.vm”, “bean.java.vm” and in the next - may be “comparator.java.vm”, as I tell you only for “core” classes without other classes for example ...factory..., ...web..., ...widget..., ...servlet... and others.
I don't know, when I'll have a free time to change current templates with jdk 1.5 features, but I try to make that during this week.
In the first time, I see implementation of “Manager.java” class in the last code, you are added Constructor that always loaded configuration for JDBC connection from a property file. When I don't want to use property file for configuration and I don't created it (for ex. I want to use DataSource and I set it directly in Manager), I 'll receive a Exception and error-message in a console when . The property file that I don't use, will be dirty project's class path. Do you think about that ?
Greetings
G.Dimitrov
Hello Florent,
I successfuly make needs changes in templates(from CVS from Monday) for JDK 1.5 support :-).
You can see them in
http://z-builder.dir.bg/_files/36120.7z
, also and my test config file.
But, I don't tested them very good :|
Please, tell me do you think about think?
Greetings,
G.Dimitrov