Announcement Announcement Module
No announcement yet.
new persistent class Errors Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • new persistent class Errors

    I'm currently using Roo 1.0.0.M1 and I was curious about how clever the pluralization add-on was, so I've been playing around with names for which I thought it might get the plural form wrong.

    Anyway, two of the names I tried created errors when I tried to create the new persistent class:

    roo> new persistent class jpa -name Tooth
    Created SRC_MAIN_JAVA\com\hello\
    String index out of range: -1
    The other one was Goose.

    Obviously this isn't urgent as I don't currently need either name in anything I'm working on at the moment, but I thought I'd mention it as there seems to be a problem there somewhere.

  • #2
    Hi Steve,

    This is interesting . The problem is caused by the inflector library which we use to generate pluralized terms for us. So we need to take a look at their code. However Roo should have rolled back based on the fact that it had an exception.

    That is a bug on our side (I also tested this in the current M2 release). I'll raise a Jira issue for it.

    In the meantime, if you want this to work anyway we have the @RooPlural annotation which lets you specify the plural term manually:

    import javax.persistence.Entity;
    import org.springframework.roo.addon.entity.RooEntity;
    import org.springframework.roo.addon.javabean.RooJavaBean;
    import org.springframework.roo.addon.tostring.RooToString;
    import org.springframework.roo.addon.plural.RooPlural;
    public class Tooth {
    Btw. If you are interested to see exceptions when something goes wrong you can use the command 'development mode' before issuing the command that is creating an exception. This helps us see what the issue is.