Menu

Turn off default value assignments in 2.6.6

Help
muru
2008-04-08
2013-04-25
  • muru

    muru - 2008-04-08

    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

     
    • Alain Fagot Béarez

      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

       
    • muru

      muru - 2008-04-10

      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

       
    • muru

      muru - 2008-04-13

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.