Package com.google.livingstories.server.dataservices.entities

Examples of com.google.livingstories.server.dataservices.entities.ThemeEntity


   
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Transaction tx = null;
   
    try {
      ThemeEntity entity = null;
      if (id == null) {
        entity = new ThemeEntity(name, livingStoryId);
      } else {
        entity = pm.getObjectById(ThemeEntity.class, id);
        entity.setName(name);
      }
      tx = pm.currentTransaction();
      tx.begin();
      pm.makePersistent(entity);
      tx.commit();
      return entity.toClientObject();
    } finally {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      pm.close();
View Full Code Here


    // First remove the theme from any content objects it may appear in
    DataImplFactory.getContentService().removeTheme(id);
    // Then delete the entity from the database
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
      ThemeEntity themeEntity = pm.getObjectById(ThemeEntity.class, id);
      pm.deletePersistent(themeEntity);
    } finally {
      pm.close();
    }
  }
View Full Code Here

        }
       
        // Theme ids
        Set<Long> themeIds = Sets.newHashSet();
        for (Long themeId : contentEntity.getThemeIds()) {
          ThemeEntity theme = themeMap.get(themeId.toString());
          if (theme != null) {
            themeIds.add(theme.getId());
          }
        }
        contentEntity.setThemeIds(themeIds);
       
        // Contributor ids
View Full Code Here

TOP

Related Classes of com.google.livingstories.server.dataservices.entities.ThemeEntity

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.