Changeset 5059


Ignore:
Timestamp:
Aug 19, 2009, 8:09:38 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #108: Logging the change history of an item

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/log/db/AnnotationLogger.java

    r5054 r5059  
    7979    // Get the type of the parent item
    8080    AnnotationSetData as = annotation.getAnnotationSet();
    81     int itemType = 0;
     81    Integer itemType = null;
    8282    if (!Hibernate.isInitialized(as))
    8383    {
     
    9292    }
    9393   
     94    // May happen in case the annotation set has been deleted in this transaction
     95    if (itemType == null) return;
     96   
    9497    // Get the id of the parent item
    9598    String parentClass = Item.fromValue(itemType).getDataClass().getName();
     
    97100      PredefinedQuery.getQueryString("DBLOG_GET_ITEMID_WITH_ANNOTATION", parentClass));
    98101    q.setInteger("annotationSetId", as.getId());
    99     int parentId = (Integer)q.uniqueResult();
     102    Integer parentId = (Integer)q.uniqueResult();
     103   
     104    // May happen in case the parent item has been deleted in this transaction
     105    if (parentId == null) return;
    100106   
    101107    ChangeHistoryDetailData change = new ChangeHistoryDetailData();
Note: See TracChangeset for help on using the changeset viewer.