Sc dsc 698 recurse del

Apologies for the size of this pull
Yeah, I think it is effectively just doing the hasNext() but has next would be much easier to read – I'll make that change.

From: Jonathan Shaw <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:43 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-22089694>:

> +            // 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
> +            String bibLevel = work.getBibLevel();
> +            if (bibLevel != null && bibLevel.equals("Set")) {
> +                for (Work child : work.getChildren()) {


I think its an iterable, so it'd need to be .getIterator.hasNext()

—
Reply to this email directly or view it on GitHub<https://github.com/nla/banjo/pull/903/files#r22089694>.