Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Pluralization error

  1. #1
    Join Date
    Jun 2009
    Posts
    4

    Default Pluralization error

    I am getting a "Could not determine the plural name" error in the final line of the following script.

    Code:
    project --topLevelPackage com.myco.testapp --projectName testapp
    persistence setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
    enum type --class ~.reference.AuditEventType
    enum constant --name SomeEventType
    enum constant --name AnotherEventType
    entity --class ~.base.AuditEvent
    field date --fieldName ts --notNull --class ~.base.AuditEvent --type java.util.Date
    field ref --fieldName eventType --notNull --type ~.reference.AuditEventType
    field string --fieldName description --notNull
    controller all --package ~.web
    The exact error is

    Could not determine the plural name for the 'eventType' field in AuditEvent
    So, I added added a @RooPlural("eventTypes") above the eventType field in the AuditEvent class, but continue to get the same message.

    Thanks in advance for any help.

    Todd

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    This seems like a bug to me. I believe the issue is that the plural support is currently only available for entities (not enum types). Can you please raise a Jira ticket for this?
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3
    Join Date
    Jun 2009
    Posts
    4

    Default

    Raised ROO-526

  4. #4
    Join Date
    Jan 2010
    Location
    Lanus, Argentina
    Posts
    28

    Default

    Hi guys!
    I'm getting the same error while running a *.roo script and the main problem is that it stops script execution...
    I mean, if it can skip this error, make a warning and log it in a file for later review , we can write the correct pluralization ...

    I'll try changing the fieldname to avoid this as a workaround...

    I'll post this comment on jira

    BTW, the word that raises the problem is "idioma" that as you may guess it's in spanish...(it means "language")

  5. #5
    Join Date
    Jan 2010
    Location
    Lanus, Argentina
    Posts
    28

    Default Newbie error (In my case)

    It seems it was a newbie fault....
    I was wrong specifying the class packages...I've rewritten the script with fully specified package names and it works fine!

    You can see the detail in jira

  6. #6
    Join Date
    Nov 2009
    Location
    Mexico City, Mexico
    Posts
    13

    Default

    I believe the problem is you are treating the enum as an entity... Try this and tell us how it goes

    Code:
    enum type --class ~.reference.AuditEventType
    enum constant --name SomeEventType
    enum constant --name AnotherEventType
    entity --class ~.base.AuditEvent
    field date --fieldName ts --notNull --class ~.base.AuditEvent --type java.util.Date
    field enum --fieldName eventType --type ~.reference.AuditEventType --notNull --enumType STRING
    field string --fieldName description --notNull
    controller all --package ~.web

  7. #7
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    667

    Default

    Quote Originally Posted by toddwh50 View Post
    Raised ROO-526
    For the link lovers: http://jira.springframework.org/browse/ROO-526

    Hopefully this will be fixed in the 1.0.1 release?
    Andrew Swan
    "Now is the EJB of our discontent made glorious Spring"

  8. #8
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Quote Originally Posted by andrews View Post
    Hopefully this will be fixed in the 1.0.1 release?
    Here in the Roo team we have a rule-of-thumb that before any release all bugs with a Jira number are either resolved OR we cannot action them for some reason (eg most commonly we're waiting on the user to give us more details, or it's a bug in an external project etc). This is one reason people can depend on Roo. We don't ship when there are known bugs and the ball is in our court to fix them.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  9. #9
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    667

    Thumbs up

    Thanks Ben, that's good to know. Not every open source project is so responsive.
    Andrew Swan
    "Now is the EJB of our discontent made glorious Spring"

  10. #10
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    Just to reiterate what I have just commented in the ROO-526 Jira ticket:

    As @ jeduan mentioned in his message above. this is not a bug. Using 'field enum' rather than 'field reference' is the expected use of this command in your case. Currently bot the 'field reference' and the 'field set' commands expect target types which are marked as JPA @Entity. I have reflected this in the current trunk (rev 572) by checking target types to be @Entity. This will hopefully make it clearer to the user. We may relax this rule in upcoming versions of Roo to make things a little more flexible when we accommodate additional persistence mechanisms other than JPA.

    The field reference and field set command expect JPA @Entity types as their referenced type and the field enum command is meant to handle references to enum types.

    I hope this clears up how enum types can be handled.
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •