I am trying to have roo create two tables
Users
id
username
password
UserRoles
id
roleName
here is my syntax:
entity --name ~.domain.UserRoles --testAutomatically
field string roleName --notNull
entity --name ~.domain.Users --testAutomatically
field string userName --notNull
field string password --notNull
field set --fieldName roles --element ~.domain.UserRoles --class ~domain.Users --fetch EAGER
as the result, it created
1) users table with user_name, password
2) user_roles with role_name
3) users_roles with "users -> references _id field from users table", "roles -> references _id field from user_roles table"
My question is that is there any way to create cascading delete/update, because from above roo commands, roo only creates "On Delete -> Restrict, On Update -> Restrict", I want to create "On Delete -> Cascade, On Update -> Cascade".
I am using MySQL.
thanks a lot!


Reply With Quote