{"action":"created","issue":{"url":"https://api.github.com/repos/ebean-orm/avaje-ebeanorm/issues/604","repository_url":"https://api.github.com/repos/ebean-orm/avaje-ebeanorm","labels_url":"https://api.github.com/repos/ebean-orm/avaje-ebeanorm/issues/604/labels{/name}","comments_url":"https://api.github.com/repos/ebean-orm/avaje-ebeanorm/issues/604/comments","events_url":"https://api.github.com/repos/ebean-orm/avaje-ebeanorm/issues/604/events","html_url":"https://github.com/ebean-orm/avaje-ebeanorm/issues/604","id":141636361,"number":604,"title":"@SoftDelete trigger","user":{"login":"0xbaadf00d","id":1005086,"avatar_url":"https://avatars.githubusercontent.com/u/1005086?v=3","gravatar_id":"","url":"https://api.github.com/users/0xbaadf00d","html_url":"https://github.com/0xbaadf00d","followers_url":"https://api.github.com/users/0xbaadf00d/followers","following_url":"https://api.github.com/users/0xbaadf00d/following{/other_user}","gists_url":"https://api.github.com/users/0xbaadf00d/gists{/gist_id}","starred_url":"https://api.github.com/users/0xbaadf00d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xbaadf00d/subscriptions","organizations_url":"https://api.github.com/users/0xbaadf00d/orgs","repos_url":"https://api.github.com/users/0xbaadf00d/repos","events_url":"https://api.github.com/users/0xbaadf00d/events{/privacy}","received_events_url":"https://api.github.com/users/0xbaadf00d/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-17T16:34:07Z","updated_at":"2016-03-21T22:56:40Z","closed_at":null,"body":"Hi,\r\n\r\nWhen @SoftDelete is used, Ebean trigger `boolean delete()` method of all Model objects linked to soft deleted object. But nothing exist when deletePermanent() is processed.\r\n\r\n\r\nBy exemple, we have a S3File model who handle link to Amazon S3 file. We want that the s3 file was deleted during a hard delete but not when we use a soft delete.\r\n\r\nIn the same way, with a OneToOne  A -- B, when A is soft delete, B too, but a.b_id is set to NULL, so when we \"undelete\" A, B is no longer linked to A."},"comment":{"url":"https://api.github.com/repos/ebean-orm/avaje-ebeanorm/issues/comments/199524671","html_url":"https://github.com/ebean-orm/avaje-ebeanorm/issues/604#issuecomment-199524671","issue_url":"https://api.github.com/repos/ebean-orm/avaje-ebeanorm/issues/604","id":199524671,"user":{"login":"rbygrave","id":208973,"avatar_url":"https://avatars.githubusercontent.com/u/208973?v=3","gravatar_id":"","url":"https://api.github.com/users/rbygrave","html_url":"https://github.com/rbygrave","followers_url":"https://api.github.com/users/rbygrave/followers","following_url":"https://api.github.com/users/rbygrave/following{/other_user}","gists_url":"https://api.github.com/users/rbygrave/gists{/gist_id}","starred_url":"https://api.github.com/users/rbygrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbygrave/subscriptions","organizations_url":"https://api.github.com/users/rbygrave/orgs","repos_url":"https://api.github.com/users/rbygrave/repos","events_url":"https://api.github.com/users/rbygrave/events{/privacy}","received_events_url":"https://api.github.com/users/rbygrave/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T22:56:40Z","updated_at":"2016-03-21T22:56:40Z","body":"The required sql and summary logging for this deletePermanent() case with lazy OneToOne is:\r\n\r\n```sql\r\nSUM - txn[1008] -- Ebean fetching foreign key values for delete of Album id:1\r\nSQL - txn[1008] select t0.id c0, t0.cover_id c1 from album t0 where t0.id = ?  ; --bind(1)\r\nSUM - txn[1008] FindBean type[Album] origin[BXUR3z.jre1M.WMipP] exeMicros[263] rows[1] bind[1]\r\nSQL - txn[1008] delete from album where id=?; --bind(1,)\r\nSUM - txn[1008] Deleted [Album] [1]\r\nSQL - txn[1008] delete from cover where id=?; --bind(1,)\r\nSUM - txn[1008] Deleted [Cover] [1]\r\n```"}}