I am having problem with default values assigned by sql2java generation against mysql.
Is there way turn off this option like in the sql2java properties file?
I really appreciate any help.
Thanks,
Muru
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Currently there is only one way to switch off the default values generation: you should edit the bean.java.vm template and replace the line beginning with:
private $column.getJavaType() $column.getVarName(); // generation without default values
I think I need to refactor all the internals of the default value logic. I will consider the possibility to switch on/off this generation through some more option in the properties.
Sorry for the inconvenience,
Alain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for help. It fixed default values issue. Yes, I agree with you and add more option in the properties file. The sql2java.xml should able to point to other location rather than default location.
But, I need one more help to resolve unsigned integer mapping. Currently, it maps to Interger instead of Long. It throws 'ObjectRetrievalException' if the value is > max integer.
Any help is highly appreciated.
-Muru
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just to let you know, I fixed unsigned integer mapping issue. I used metadata 'TYPE_NAME' for column to identify INT or INT UNSIGNED and return Long or Integer.
I tested it against mySQL and works fine.
Thanks,
Muru
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am having problem with default values assigned by sql2java generation against mysql.
Is there way turn off this option like in the sql2java properties file?
I really appreciate any help.
Thanks,
Muru
Hi Muru,
Currently there is only one way to switch off the default values generation: you should edit the bean.java.vm template and replace the line beginning with:
private $column.getJavaType() $column.getVarName()#if ( (!$column.isPrimaryKey()) && [...]
by the following one:
private $column.getJavaType() $column.getVarName(); // generation without default values
I think I need to refactor all the internals of the default value logic. I will consider the possibility to switch on/off this generation through some more option in the properties.
Sorry for the inconvenience,
Alain
Hi Alain,
Thanks for help. It fixed default values issue. Yes, I agree with you and add more option in the properties file. The sql2java.xml should able to point to other location rather than default location.
But, I need one more help to resolve unsigned integer mapping. Currently, it maps to Interger instead of Long. It throws 'ObjectRetrievalException' if the value is > max integer.
Any help is highly appreciated.
-Muru
Hi Alain,
Just to let you know, I fixed unsigned integer mapping issue. I used metadata 'TYPE_NAME' for column to identify INT or INT UNSIGNED and return Long or Integer.
I tested it against mySQL and works fine.
Thanks,
Muru