Examples of BaseEntity


Examples of org.libreplan.business.common.BaseEntity

        if (bean == null) {
            // this shouldn't happen, just in case
            return "null";
        }
        if (bean instanceof BaseEntity) {
            BaseEntity entity = (BaseEntity) bean;
            return bean.getClass().getSimpleName() + " "
                    + entity.getExtraInformation();
        }
        return bean.toString();
    }
View Full Code Here

Examples of org.opentides.bean.BaseEntity

        method.invoke(entity, session.load(type, id));
      } else {
        method.invoke(entity, type.cast(value));
      }
    }
    BaseEntity baseEntity = (BaseEntity)entity;
    baseEntity.setSkipAudit(true);
    session.persist(baseEntity);
  }
View Full Code Here

Examples of org.opentides.bean.BaseEntity

     */
    @PostPersist
    public final void setOwner(final UserDefinable entity) {
      if ( (entity.getUdf()!=null) &&
         entity instanceof BaseEntity) {
        BaseEntity baseEntity = (BaseEntity) entity;
        entity.getUdf().setEntityClass(entity.getClass());
        entity.getUdf().setEntityId(baseEntity.getId());
      }
    }
View Full Code Here

Examples of org.opentides.bean.BaseEntity

  }
 
  @Override
  public String getAsText() {
    if (getValue() != null) {
      BaseEntity editor = (BaseEntity) getValue();
      return editor.getId().toString();
    }
    return "";
  }
View Full Code Here

Examples of org.opentides.bean.BaseEntity

  @Override
  public void setAsText(String text) throws IllegalArgumentException {
    try {
      if (!StringUtil.isEmpty(text)) {
        BaseEntity entity = entityService.load(text);
        setValue(entity);
      } else
        setValue(null);
    } catch (IllegalArgumentException iae) {
      _log.error("Failed to convert BaseEntity via ["+entityService.getClass().getName()+"]",iae);
View Full Code Here

Examples of org.opentides.bean.BaseEntity

          clause.append(property)
          .append(".key")
          .append(" = '")
          .append(sc.getKey()+"'");
        } else if(BaseEntity.class.isAssignableFrom(ret.getClass())) {
          BaseEntity be = (BaseEntity) ret;
          clause.append(property)
          .append(".id")
          .append(" = ")
          .append(be.getId());
        } else if (Integer.class.isAssignableFrom(ret.getClass()) ||
               Float.class.isAssignableFrom(ret.getClass()) ||
               Long.class.isAssignableFrom(ret.getClass()) ||
               Double.class.isAssignableFrom(ret.getClass()) ||
               BigDecimal.class.isAssignableFrom(ret.getClass()) ||
View Full Code Here

Examples of org.opentides.bean.BaseEntity

            buff.append("'")
              .append(entity.getKey())
              .append("'");
          } else
          if (BaseEntity.class.isAssignableFrom(item.getClass())) {
            BaseEntity entity  = (BaseEntity) item;
            // use id
            buff.append(entity.getId());
          } else
            buff.append("'")
            .append(item.toString())
            .append("'");
        }
View Full Code Here

Examples of org.springframework.samples.petclinic.BaseEntity

   */
  public static BaseEntity getById(Collection entities, Class entityClass, int entityId)
      throws ObjectRetrievalFailureException {

    for (Iterator it = entities.iterator(); it.hasNext();) {
      BaseEntity entity = (BaseEntity) it.next();
      if (entity.getId().intValue() == entityId && entityClass.isInstance(entity)) {
        return entity;
      }
    }
    throw new ObjectRetrievalFailureException(entityClass, new Integer(entityId));
  }
View Full Code Here

Examples of org.vosao.entity.BaseEntity

    Map<Long, BaseEntity> result = new HashMap<Long, BaseEntity>();
    try {
      getDaoStat().incGetCalls();
      Map<Key, Entity> loaded = getSystemService().getDatastore().get(keys);
      for (Key key : loaded.keySet()) {
        BaseEntity model = (BaseEntity)clazz.newInstance();
        model.load(loaded.get(key));
        result.put(model.getId(), model);
      }
    }
    catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of org.vosao.entity.BaseEntity

        if (item != null) {
          Date globalResetDate = getCache().getResetDate();
          if (globalResetDate == null
              || item.getTimestamp().after(globalResetDate)) {
            getDaoStat().incEntityCacheHits();
            BaseEntity entity = (BaseEntity)item.getData();
            result.put(entity.getId(), entity);
          }
         
        }
      }
    }
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.