IIUC, It's passing IDs and using them as IDs.  The problem is there's no way to know which entity the ID actually refers to since IDs are not (AFAIK) globally unique, hence the sequential search through multiple tables.  The code just accepts the first non-null entity that happens to have that ID.



From: Denis Yuen <notifications@github.com<mailto:notifications@github.com>>
Reply-To: SeqWare/seqware <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Friday, 9 August, 2013 5:02 PM
To: SeqWare/seqware <seqware@noreply.github.com<mailto:seqware@noreply.github.com>>
Cc: Alexander Taggart <alexander.taggart@oicr.on.ca<mailto:alexander.taggart@oicr.on.ca>>
Subject: Re: [seqware] Refactoring strings into enums. (#74)


In seqware-common/src/main/java/net/sourceforge/seqware/common/metadata/MetadataWS.java:

> -                Study study = ll.existsStudy(parentID);
> -                Experiment exp = ll.existsExperiment(parentID);
> -                Sample samp = ll.existsSample(parentID);
> -
> -                if (pr != null) {
> +                Processing pr;
> +                Lane l;
> +                IUS i;
> +                SequencerRun sr;
> +                Study study;
> +                Experiment exp;
> +                Sample samp;
> +
> +                // TODO: I've moved the fetching so that it only occurs when needed,
> +                //       but should we really just associate to the first entity that
> +                //       happens to have the (not globally unique) ID?


Is this passing in IDs, but using them as accessions? Is that the concern here?

—
Reply to this email directly or view it on GitHub<https://github.com/SeqWare/seqware/pull/74/files#r5693571>.