Sc dsc 698 recurse del

Apologies for the size of this pull
Good question I say, but it's the spec apparently.

From: Aaron Muller <notifications@github.com<mailto:notifications@github.com>>
Reply-To: nla/banjo <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Friday, 19 December 2014 3:20 PM
To: nla/banjo <banjo@noreply.github.com<mailto:banjo@noreply.github.com>>
Cc: Shaun Coen <scoen@nla.gov.au<mailto:scoen@nla.gov.au>>
Subject: Re: [banjo] Sc dsc 698 recurse del (#903)


In src/banjo/controllers/WorksController.java<https://github.com/nla/banjo/pull/903#discussion-diff-22089273>:

> -            String parentId = (work.getParent() == null) ? "" : work.getParent().getObjId();
> +        try (AmberSession sess = amberDbService.get()) {
> +
> +            // load the entire work in question
> +            Work work = sess.findWork(objectId);
> +            sess.loadMultiLevelWorks(work.getId());
> +
> +            // we should have everything, so to speed
> +            // things up only look at in-memory graph
> +            sess.setLocalMode(true);
> +
> +            // save the full nla.obj-123456 style id and the work's parent for later
> +            String objId = work.getObjId();
> +            Work parent = work.getParent();
> +
> +            // fail if this work is a set and has any children


Why does this fail if it's a set and has children?

—
Reply to this email directly or view it on GitHub<https://github.com/nla/banjo/pull/903/files#r22089273>.