Hi guys,
I'm starting a new app and of course I want to use Roo for it. So just two quick questions for my entities:
How do I express a dictionary? In my case, I want a translatable text, so I've done this:
This is wrong, but how should I express a dictionary correctly?Code:entity --class ~.data.entities.WrittenLanguage field string --fieldName name entity --class ~.data.entities.TranslateableText field other --type java.util.HashMap<WrittenLanguage, String> --fieldName text
The second question is that I want to have a set of permissions, so I define the following:
Roo is shocked that I even dare think this and quickly says: "The field set command is only applicable to JPA @Entity elements" I disagree, there are ways of expressing this, such as AND'ing the enums together and expressing it as an Integer or something. What is the correct way of doing this with Roo?Code:enum type --class ~.data.enums.Permission enum constant --name UPDATE_ELEMENT enum constant --name DELETE_ELEMENT enum constant --name CREATE_ELEMENT enum constant --name ADD_USER enum constant --name BAN_USER entity --class ~.data.entities.Person --extends Super field string --fieldName username field string --fieldName password field string --fieldName email field string --fieldName name field set --fieldName permissions --element ~.data.enums.Permission
Cheers
Nik


Reply With Quote
