So, when I have a User object called user, I can get the groupSet of this user via the UserGroup, like so: user.group.groupSet.name (variant A in the code example below)
When I accidentally used groupSet on the User object directly, I found it gives the same result (variant B in the code example below). I am not sure I understand why this works, when the User class itself has no getGroupSet(), according to the api docs. Is this safe to use or could it stop working at any Cyclos update because it is not in the api docs?
Code: Select all
import org.cyclos.entities.users.User String userName = 'johnDoe' User user = conversionHandler.convert(User, userName) // A. Getting the groupSet via the group: this works and this is what I would expect. return user.group.groupSet.name // B. Getting the groupSet directly from the user: this also works, but why? return user.groupSet.name
Using Cyclos 4.11.1