In the bean.java.vm files there is a facility to make the generated bean extend a class. The code checks for the presence of a value in $extendsClass. But I can not find anywhere that $extendsClass gets set, it is not present in any of the source code (or at least that is what grep tells me).
The relevant bit of bean.java.vm reads:-
public class $beanClass
#if ($extendsClass)
extends $extendsClass
#end
implements GeneratedBean
#if ($implementsClasses)
#foreach( $implements in $implementsClasses )$implements#end
#end
I suppose I would expect it to be set somewhere like section 3/8 of sql2java.properties "Generated Source" code, but I can not spot anywhere that looks right.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1- in the includes/table.include.vm if it has to be known by all the templates managing tables;
2- in the bean.java.vm itself if it is (as its seems to be) the place where it is used.
the former one, if you get one base class generated for each table (by adding a new template);
the latter one, if you have some abstract class all generated classes will extend.
If you would like it to be set according to more complex rules... you may have to wait for the scripting functionality of version 3.0 to be released.
Hope this helps,
Alain.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the bean.java.vm files there is a facility to make the generated bean extend a class. The code checks for the presence of a value in $extendsClass. But I can not find anywhere that $extendsClass gets set, it is not present in any of the source code (or at least that is what grep tells me).
The relevant bit of bean.java.vm reads:-
public class $beanClass
#if ($extendsClass)
extends $extendsClass
#end
implements GeneratedBean
#if ($implementsClasses)
#foreach( $implements in $implementsClasses )$implements#end
#end
I suppose I would expect it to be set somewhere like section 3/8 of sql2java.properties "Generated Source" code, but I can not spot anywhere that looks right.
I am personally thinking of two ways to set it:
1- in the includes/table.include.vm if it has to be known by all the templates managing tables;
2- in the bean.java.vm itself if it is (as its seems to be) the place where it is used.
You could use some definition like
#set ( $extendsClass = Base$table.asCoreClass() )
or
#set ( $extendsClass = AbstractBean )
the former one, if you get one base class generated for each table (by adding a new template);
the latter one, if you have some abstract class all generated classes will extend.
If you would like it to be set according to more complex rules... you may have to wait for the scripting functionality of version 3.0 to be released.
Hope this helps,
Alain.