-
Notifications
You must be signed in to change notification settings - Fork 7
ExpObjectDataIterator: consolidate iterator logic #6788
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
base: develop
Are you sure you want to change the base?
Conversation
try | ||
{ | ||
if (_isSample) | ||
ExpObject expObject = null; | ||
if (_context.getInsertOption().mergeRows && _nameCol != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this isn't your doing, but it's not clear why this logic about the name column is inside the if
for the lsid
being a string. The lsid
comes into play only if the object isn't found by name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes. I agree, this logic was pretty snarled. I've refactored this to not be nested in the lsid
check. See 7cb5ff1.
experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java
Outdated
Show resolved
Hide resolved
6c62e5d
to
e694ba8
Compare
} | ||
} | ||
} | ||
else if (_lsidCol != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's kind of silly, but you could have both the name and the LSID columns, so perhaps this logic should be more like in the FlagDataIterator where we go into the lsid
block of obj
is null?
{ | ||
for (Map.Entry<String, Object> entry : _lsidAliasMap.entrySet()) | ||
if (_context.getInsertOption().mergeRows && _nameCol != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the check for mergeRows
here is correct. Couldn't you also have a _nameCol
for the update case?
|
||
Object flagValue = get(_flagCol); | ||
ExpObject expObject = null; | ||
if (_nameCol != null && _context.getInsertOption().mergeRows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here about merge vs. update.
Rationale
This is the remanent refactor of prior work done to address Issue 53153.
Related Pull Requests
Changes
ExpDataTypeDataIterator
to encapsulate logic for data iterators that operate on experiment materials and data.FlagDataIterator
logic to not rely on presence oflsid
column