Package org.rssowl.core.internal.persist

Examples of org.rssowl.core.internal.persist.Description


        news.setId(id);

        String description = ((News) news).getTransientDescription();
        if (description != null) {
          mergeResult.addUpdatedObject(new Description(news, description));
        }
      }

      /* Return early on cancellation */
      if (monitor.isCanceled() || Owl.isShuttingDown())
View Full Code Here


  public Description load(long newsId) {
    Query query = fDb.query();
    query.constrain(Description.class);
    query.descend("fNewsId").constrain(newsId); //$NON-NLS-1$
    Description description = getSingleResult(query);
    fDb.activate(description, Integer.MAX_VALUE);
    return description;
  }
View Full Code Here

    fDb.activate(description, Integer.MAX_VALUE);
    return description;
  }

  public String loadValue(long newsId) {
    Description description = load(newsId);
    return description == null ? null : description.getValue();
  }
View Full Code Here

      oc.activate(news, Integer.MAX_VALUE);
      String descriptionFieldName = "fDescription"; //$NON-NLS-1$
      String descriptionValue = (String) MigrationHelper.getFieldValue(news, descriptionFieldName);
      if (descriptionValue != null) {
        MigrationHelper.setField(news, descriptionFieldName, null);
        Description description = new Description(news, descriptionValue);
        oc.ext().store(description, Integer.MAX_VALUE);
        oc.ext().store(news, Integer.MAX_VALUE);
      }
      ++i;
      if (newsCountPerIncrement == 0) {
View Full Code Here

     * not been changed.
     */
    if (!n.isTransientDescriptionSet())
      return;

    Description dbDescription = null;
    String dbDescriptionValue = null;

    dbDescription = getDescriptionDAO().load(news.getId());
    if (dbDescription != null)
      dbDescriptionValue = dbDescription.getValue();

    String newsDescriptionValue = n.getTransientDescription();

    /*
     * If the description in the news has been set to null and it's already null
     * in the database, there is nothing to do.
     */
    if (dbDescriptionValue == null && newsDescriptionValue == null)
      return;

    else if (dbDescriptionValue == null && newsDescriptionValue != null)
      db.store(new Description(news, newsDescriptionValue));

    else if (dbDescriptionValue != null && newsDescriptionValue == null)
      db.delete(dbDescription);

    else if (dbDescriptionValue != null && !dbDescriptionValue.equals(newsDescriptionValue)) {
      if (dbDescription != null) {
        dbDescription.setDescription(newsDescriptionValue);
        db.store(dbDescription);
      }
    }
  }
View Full Code Here

    for (ICategory category : ReverseIterator.createInstance(news.getCategories()))
      fDb.delete(category);
    for (IAttachment attachment : ReverseIterator.createInstance(news.getAttachments()))
      fDb.delete(attachment);

    Description description = DBHelper.getDescriptionDAO().load(news.getId());
    if (description != null)
      fDb.delete(description);
  }
View Full Code Here

   */
  public Description load(long newsId) {
    Query query = fDb.query();
    query.constrain(Description.class);
    query.descend("fNewsId").constrain(newsId); //$NON-NLS-1$
    Description description = getSingleResult(query);
    fDb.activate(description, Integer.MAX_VALUE);
    return description;
  }
View Full Code Here

  /*
   * @see org.rssowl.core.internal.persist.dao.IDescriptionDAO#loadValue(long)
   */
  public String loadValue(long newsId) {
    Description description = load(newsId);
    return description == null ? null : description.getValue();
  }
View Full Code Here

    for (ICategory category : ReverseIterator.createInstance(news.getCategories()))
      fDb.delete(category);
    for (IAttachment attachment : ReverseIterator.createInstance(news.getAttachments()))
      fDb.delete(attachment);

    Description description = DBHelper.getDescriptionDAO().load(news.getId());
    if (description != null)
      fDb.delete(description);
  }
View Full Code Here

      oc.activate(news, Integer.MAX_VALUE);
      String descriptionFieldName = "fDescription"; //$NON-NLS-1$
      String descriptionValue = (String) MigrationHelper.getFieldValue(news, descriptionFieldName);
      if (descriptionValue != null) {
        MigrationHelper.setField(news, descriptionFieldName, null);
        Description description = new Description(news, descriptionValue);
        oc.ext().set(description, Integer.MAX_VALUE);
        oc.ext().set(news, Integer.MAX_VALUE);
      }

      ++i;
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.Description

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.