Package org.rssowl.core.persist.service

Examples of org.rssowl.core.persist.service.IDGenerator


      /* Return early on cancellation */
      if (monitor.isCanceled() || Owl.isShuttingDown())
        return;

      /* Set ID to News and handle Description entity */
      IDGenerator generator = Owl.getPersistenceService().getIDGenerator();
      for (INews news : newNewsAdded) {

        /* Return early on cancellation */
        if (monitor.isCanceled() || Owl.isShuttingDown())
          return;

        long id;
        if (generator instanceof DB4OIDGenerator)
          id = ((DB4OIDGenerator) generator).getNext(false);
        else
          id = generator.getNext();

        news.setId(id);

        String description = ((News) news).getTransientDescription();
        if (description != null) {
View Full Code Here


  private void setId(IEntity entity) {
    if (entity.getId() == null) {
      long id;

      IDGenerator idGenerator = getIDGenerator();
      if (idGenerator instanceof DB4OIDGenerator)
        id = ((DB4OIDGenerator) idGenerator).getNext(false);
      else
        id = idGenerator.getNext();

      entity.setId(id);
    }
  }
View Full Code Here

  private void setId(IEntity entity) {
    if (entity.getId() == null) {
      long id;

      IDGenerator idGenerator = getIDGenerator();
      if (idGenerator instanceof DB4OIDGenerator)
        id = ((DB4OIDGenerator) idGenerator).getNext(false);
      else
        id = idGenerator.getNext();

      /*
       * We must release the read lock before we can change the id of the
       * news. This should be fine because if the News has no id, it means
       * that it's not known to anyone but the caller and we will acquire the
View Full Code Here

  private void setId(IEntity entity) {
    if (entity.getId() == null) {
      long id;

      IDGenerator idGenerator = getIDGenerator();
      if (idGenerator instanceof DB4OIDGenerator)
        id = ((DB4OIDGenerator) idGenerator).getNext(false);
      else
        id = idGenerator.getNext();

      /*
       * We must release the read lock before we can change the id of the news.
       * This should be fine because if the News has no id, it means that it's
       * not known to anyone but the caller and we will acquire the read lock
View Full Code Here

      /* Return early on cancellation */
      if (monitor.isCanceled() || Owl.isShuttingDown())
        return;

      /* Set ID to News and handle Description entity */
      IDGenerator generator = Owl.getPersistenceService().getIDGenerator();
      for (INews news : newNewsAdded) {

        /* Return early on cancellation */
        if (monitor.isCanceled() || Owl.isShuttingDown())
          return;

        long id;
        if (generator instanceof DB4OIDGenerator)
          id = ((DB4OIDGenerator) generator).getNext(false);
        else
          id = generator.getNext();

        news.setId(id);

        String description = ((News) news).getTransientDescription();
        if (description != null) {
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.service.IDGenerator

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.