Announcement Announcement Module
Collapse
No announcement yet.
Setting a field after it had been created Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting a field after it had been created

    Hi All:

    I did the following

    ~.domain.Users roo> field string --fieldName userName

    forgot to make this userName not null
    How do I do that , after I have already created the field ?

    Do I have an option of doing so ?

    Thanks
    rohit

  • #2
    I bet you can aggregate the apropiate validation annotation to your java code manually without further problems for example

    @NotNull
    private String userName

    Thatīs the best of Roo, your project is a normal java project (with steroids) and you can do manually or replace whatever you want without Roo complaining.

    HTH
    Raúl

    Comment


    • #3
      Yep ! you are rite - that's what I did

      I was thinking one thing tho when I asked that question -

      I would ultimately want to record my "roo" scripts (for whatever reasons) once I am done with my roo shell commands. Now that won't be possible if some of my work is done manually and some from the shell , isn't it ?

      Thanks
      rohit

      Comment


      • #4
        Roo will record your scripts for you, but i think you are rigth and it will not record manual work (i wonder if itīs possible to record it), but you can manually add it to your scripts after finished, for example if your generated script is

        ~.domain.Users roo> field string --fieldName userName

        You can allways edit it to add the --nonNull parameter, that way when you execute the script the next time you will have less manual work to do .

        Regards, Raul

        Comment


        • #5
          Yes, the Roo shell will record all commands. Look for log.roo in the project root. Manual changes to your Java code (such as @NotNull addition) is however not recorded. But you can add it easily to your field command in the log and rerun the script if you want.

          Comment

          Working...
          X