Create table with default column values

Nelson R
2012-01-08
2012-09-29
  • Nelson R
    Nelson R
    2012-01-08

    Is there support for default column values in the library? If so, could you
    please post a small piece of code that illustrates how to make use of it.

    Thank you.

     
  • James Ahlborn
    James Ahlborn
    2012-01-08

    no, not currently. feel free to file a feature request. you could fudge it for
    now by adding an initial custom constraint, e.g.:

    createQuery.addColumnConstraint(col, SqlObjectlist.create(" ").addObjects(new CustomSql("DEFAULT"), value));
    
     
  • James Ahlborn
    James Ahlborn
    2012-01-11

    The trunk now has support for column default values, and this will be in the
    2.0.11 release.

     
  • Nelson R
    Nelson R
    2012-01-11

    That's great! Thank you jahlborn!