Examples of JpaPersistentItem


Examples of org.openhab.persistence.jpa.internal.model.JpaPersistentItem

    }
   
    // determine item name to be stored
    String name = (alias != null) ? alias : item.getName();
   
    JpaPersistentItem pItem = new JpaPersistentItem();
    try {
      pItem.setValue(StateHelper.toString(item.getState()));
    } catch (Exception e1) {
      logger.error("Error on converting state value to string: {}", e1.getMessage());
      return;
    }
    pItem.setName(name);
    pItem.setRealName(item.getName());
    pItem.setTimestamp(new Date());

    EntityManager em = getEntityManagerFactory().createEntityManager();
    try {
      logger.debug("Persisting item...");
      // In RESOURCE_LOCAL calls to EntityManager require a begin/commit     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.