Changeset 6779


Ignore:
Timestamp:
Mar 17, 2015, 3:51:21 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1930: Can't run batch importers in 'create' mode when using multiple lines per item

If the found item is a new item not yet stored in the database the updateMultiLineItem is allowed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.4-stable/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r6520 r6779  
    751751      itemCache.put(cacheKey, item);
    752752      lastItem = item;
    753       if (failIfItemExists)
    754       {
     753      if (failIfItemExists && !sameAsLast)
     754      {
     755        // Fail if this is the first time we see this item
    755756        throw new ItemAlreadyExistsException(itemQuery.getItemType()+"[" + idMethod + "=" + identifier + "]");
    756757      }
    757       else if (updateExistingItems)
    758       {
     758      else if (updateExistingItems || (sameAsLast && !item.isInDatabase()))
     759      {
     760        // Update existing items or second line of new items in 'create' mode
    759761        try
    760762        {
Note: See TracChangeset for help on using the changeset viewer.