Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Args passed to delete are lost #10

Open
wayco opened this issue May 9, 2014 · 0 comments
Open

Args passed to delete are lost #10

wayco opened this issue May 9, 2014 · 0 comments

Comments

@wayco
Copy link

wayco commented May 9, 2014

Let me preface by saying that I'm relatively new to Grails and, as such, may be speaking out of ignorance here. If so, I apologize.

When I run a simple test with logical-delete, it doesn't work as expected. For example, TestEntity is annotated with @LogicalDelete

TestEntity te = new TestEntity(....)
te.save(flush:true)
def recordId = te.id
te.delete(flush:true)
println TestEntity.findById(recordId) //we'd expect null
println TestEntity.get(recordId) //we'd expect the entity

Both calls retrieve the entity even after the call to delete. By logging SQL, I can verify that both filter and delete "hijack" are working. But, the flush:true has no effect when passed to delete,

I can obtain the desired behavior by altering LogicalDeleteClassEnhancer#changeDeleteMethod and LogicalDeleteClassEnhancer#deleteAction such that we're always invoking save w/ arguments, but not sure that's the best way through...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant