Package com.opensymphony.module.propertyset.hibernate

Examples of com.opensymphony.module.propertyset.hibernate.PropertySetItem


        }
        */
       
       
        Session session = null;
        PropertySetItem item = null;

        try {
            session = this.sessionFactory.openSession();
            item = InfoglueHibernatePropertySetDAOUtils.getItem(session, entityName, entityId, key);
            session.flush();
        } catch (HibernateException e) {
            //t.printElapsedTime("FindByKey empty: " + entityName + ":" + entityId + ":" + key);
          //e.printStackTrace();
           
            return null;
        } finally {
            try {
                if (session != null) {
                    session.close();
                }
            } catch (Exception e) {
            }
        }
       
        if(valueMap != null)
          valueMap.put(key, item);
        if(key.equals("workflow_status") || key.indexOf("languageId") > -1)
        {
          logger.info("Key:" + key);
          logger.info("Item:" + item.getType());
          logger.info("Item:" + item.getStringVal());
        }

        //t.printElapsedTime("FindByKey: " + entityName + ":" + entityId + ":" + key);
        return item;
    }
View Full Code Here


  /**
   *
   */
    protected void setDataImpl(int type, String key, Object value) throws PropertyException
    {
    PropertySetItem item = configProvider.getPropertySetDAO().findByKey(entityName, entityId, key);
        boolean update = (item == null) ? false : true;
        if (item == null)
        {
            item = configProvider.getPropertySetDAO().create(entityName, entityId.longValue(), key);
        }
        else if (item.getType() != type)
        {
            throw new PropertyException("Existing key '" + key + "' does not have matching type of " + type);
        }
   
    ((InfogluePropertySetItem) item).setDataVal(((com.opensymphony.util.Data) value).getBytes());
   
        item.setType(type);
        configProvider.getPropertySetDAO().setImpl(item, update);
    }
View Full Code Here

  /**
   *
   */
  private Object getData(int type, String key) throws PropertyException
  {
        final PropertySetItem item = findByKey(key);
        if (item == null)
        {
            return null;
        }
        if (item.getType() != type)
        {
            throw new PropertyException("key '" + key + "' does not have matching type of " + type);
        }
    return new com.opensymphony.util.Data(((InfogluePropertySetItem) item).getDataVal());
    }
View Full Code Here

TOP

Related Classes of com.opensymphony.module.propertyset.hibernate.PropertySetItem

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.