jdaugherty opened a new issue, #317:
URL: https://github.com/apache/grails-intellij-plugin/issues/317
I am using UUIDs as the ID of my domain objects, each of them has a UUID id
field directly in the class, rather than relying on a common trait which
defines it (as it was picked up by IDEA as a Long in that case as well).
When I have a reference to another domain object, and use the generated
referenceId getter, IDEA treats it as a Long and will give an inspection error
if it's used where a UUID is expected.
Example:
User domain object has these fields:
UUID id
String username
Role domain object has these fields:
UUID id
String name
UserRole domain object has these fields
User user
Role role
If I do something like the following, I get an inspection warning when I
call .put on the Map or .add on the list
```
Map<UUID, List<UUID>> userIdsByRoleId = new HashMap<UUID, List<UUID>>()
UserRole.list().each { UserRole userRole ->
List<UUID> userIds = userIdsByRoleId.get(userRole.roleId)
if (userIds == null) {
userIds = new ArrayList<UUID>()
userIdsByRoleId.put(userRole.roleId, userIds)
}
userIds.add(userRole.userId)
}
```
---
*Imported from
[IDEA-177687](https://youtrack.jetbrains.com/issue/IDEA-177687) · Type: Bug ·
Votes: 0*
*Comments, attachments, dates and reporter are not part of the export —
follow the link above for the full history.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]