Package org.nightlabs.jfire.trade

Examples of org.nightlabs.jfire.trade.Article


    Collection<DirtyObjectID> res = null;
    PersistenceManager pm = event.getPersistenceManager();
    iterateDirtyObjectIDs: for (DirtyObjectID dirtyObjectID : event.getDirtyObjectIDs()) {
      boolean add = false;

      Article article = null;
      try {
        article = (Article) pm.getObjectById(dirtyObjectID.getObjectID());
      } catch (JDOObjectNotFoundException x) {
        // the object has already been deleted => we ignore it if this filter isn't for deleted objects (which it should never be as deletion should tracked using implicit listeners as best practice)
        for (JDOLifecycleState state : jdoLifecycleStates) {
          if (JDOLifecycleState.DELETED.equals(state))
            add = true;
          else
            continue iterateDirtyObjectIDs;
        }
      }

      if (articleContainerID instanceof OrderID) {
        if (articleContainerID.equals(article.getOrderID()))
          add = true;
      }
      else if (articleContainerID instanceof OfferID) {
        if (articleContainerID.equals(article.getOfferID()))
          add = true;
      }
      else if (articleContainerID instanceof InvoiceID) {
        if (articleContainerID.equals(article.getInvoiceID()))
          add = true;
      }
      else if (articleContainerID instanceof DeliveryNoteID) {
        if (articleContainerID.equals(article.getDeliveryNoteID()))
          add = true;
      }
      else
        throw new IllegalStateException("articleContainerID is an instance of an unsupported class: " + articleContainerID);
View Full Code Here

TOP

Related Classes of org.nightlabs.jfire.trade.Article

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.