grails logical delete

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

grails logical delete

Praneeth Reddy
Grails logical delete is a good option to perform soft delete on entities.Let me explain the issue which i am facing

1.I implemented my domain class User with  LogicalDelete<User>
2.If i retrieve the user list, its filtering the deleted objects by default and giving the list.

3.Now i have one more class called UserRole which contains user and role.
4.When i am trying to get the users from UserRole objects, the delete filtering is not happening by default

def result = UserRole.findAll {
role == "ROLE_USER"
}.collect { it.user }

result includes deleted objects also.

Now my question is how can i perform deleted objects filtering from other objects which contains User object (by enabling the default delete filtering )

Except mentioning the property (deleted = false)

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/3f11df68-990d-45e3-a02a-226b143b6924%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.