Examples of EntityBean


Examples of com.avaje.ebean.bean.EntityBean

            }
        }

        Object read(DbReadContext ctx) throws SQLException {

            EntityBean embeddedBean = targetDescriptor.createEntityBean();

            boolean notNull = false;
            for (int i = 0; i < embeddedProps.length; i++) {
                Object value = embeddedProps[i].readSet(ctx, embeddedBean, null);
                if (value != null) {
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

 
  /**
   * Returns true if it managed to populate/load the bean from the cache.
   */
  public boolean cacheBeanLoad(EntityBeanIntercept ebi) {
    EntityBean bean = ebi.getOwner();
    Object id = getId(bean);
    return cacheBeanLoad(bean, ebi, id);
  }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

  /**
   * Creates a new EntityBean.
   */
  public EntityBean createEntityBean() {
    try {
      EntityBean bean = (EntityBean)prototypeEntityBean._ebean_newInstance();
     
      if (unloadProperties.length > 0) {
        // 'unload' any properties initialised in the default constructor
        EntityBeanIntercept ebi = bean._ebean_getIntercept();
        for (int i = 0; i < unloadProperties.length; i++) {
          ebi.setPropertyUnloaded(unloadProperties[i]);
        }
      }
      return bean;
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

          return (T) shareableBean;
        }
      }
    }
    try {
      EntityBean eb = createEntityBean();

      convertSetId(id, eb);

      EntityBeanIntercept ebi = eb._ebean_getIntercept();
      ebi.setBeanLoader(ebeanServer);

      // Note: not creating proxies for many's...
      ebi.setReference(idPropertyIndex);
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

      context = new DefaultPersistenceContext();
    }

    // Not using a loadContext for beans coming out of L2 cache
    // so that means no batch lazy loading for these beans
    EntityBean entityBean = (EntityBean)bean;
    EntityBeanIntercept ebi = entityBean._ebean_getIntercept();
    ebi.setPersistenceContext(context);
    Object id = desc.getId(entityBean);
    context.put(id, bean);

  }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

        }
        return (T) bean;
      }
    }

    EntityBean bean = desc.createEntityBean();
    desc.convertSetId(id, bean);
    EntityBeanIntercept ebi = bean._ebean_getIntercept();
    ebi.setBeanLoader(desc.getEbeanServer());
   
    if (Boolean.TRUE.equals(readOnly)) {
      ebi.setReadOnly(true);
    }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    String propName = parser.getCurrentName();     
    if (!propName.equalsIgnoreCase(discColumn)) {
      // just try to assume this is the correct bean type in the inheritance
      BeanProperty property = desc.getBeanProperty(propName);
      if (property != null) {
        EntityBean bean = desc.createEntityBean();
        property.jsonRead(parser, bean);
        return jsonReadProperties(parser, bean);
      }
      String msg = "Error reading inheritance discriminator, expected property ["+discColumn+"] but got [" + propName + "] ?";
      throw new JsonParseException(msg, parser.getCurrentLocation());
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    return (T) localDescriptor.jsonReadObject(parser, path);
  }
 
  protected T jsonReadObject(JsonParser parser, String path) throws IOException {

    EntityBean bean = desc.createEntityBean();
    return jsonReadProperties(parser, bean);
  }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

   * Find and return a single bean using its unique id.
   */
  @SuppressWarnings("unchecked")
  public <T> T find(OrmQueryRequest<T> request) {

    EntityBean bean = null;

    CQuery<T> cquery = queryBuilder.buildQuery(request);

    try {
      cquery.prepareBindExecuteQuery();
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

                if (imported[i].owner.isDbUpdatable()) {
                    request.appendColumnIsNull(imported[i].localDbColumn);
                }
      }
    } else {
      EntityBean embedded = (EntityBean)embeddedId;
      for (int i = 0; i < imported.length; i++) {
          if (imported[i].owner.isDbUpdatable()) {
            Object value = imported[i].foreignProperty.getValue(embedded);
            if (value == null){
              request.appendColumnIsNull(imported[i].localDbColumn)
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.