Examples of EntityBean


Examples of com.avaje.ebean.bean.EntityBean

    }

    Object collection = many.createEmpty(false);
    BeanCollectionAdd add = many.getBeanCollectionAdd(collection, null);
    do {
      EntityBean detailBean = (EntityBean) many.targetDescriptor.jsonRead(parser, many.name);
      if (detailBean == null) {
        // read the entire array
        break;
      }
      add.addBean(detailBean);
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

   
    SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
    BeanDescriptor<Customer> custDesc = server.getBeanDescriptor(Customer.class);
   
    Customer customer = new Customer();
    EntityBean eb = (EntityBean)customer;
    EntityBeanIntercept ebi = eb._ebean_getIntercept();
   
    BeanProperty contactsProperty = custDesc.getBeanProperty("contacts");
    Assert.assertFalse(ebi.isLoadedProperty(contactsProperty.getPropertyIndex()));
   
    Object contactsViaInternal = contactsProperty.getValue(eb);
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

        .fetch("billingAddress","id");
       
    LoggedSqlCollector.start();
   
    Customer customer = query.findUnique();
    EntityBean eb = (EntityBean)customer;
    EntityBeanIntercept ebi = eb._ebean_getIntercept();
   
    Assert.assertTrue(ebi.isFullyLoadedBean());
   
    // find the internal property index for "billingAddress"
    String[] propNames = eb._ebean_getPropertyNames();
    int pos = 0;
    for (int i = 0; i < propNames.length; i++) {
      if (propNames[i].equals("billingAddress")) {
        pos = i;
      }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    importedId.dmlAppend(request);
  }

  public void dmlBind(BindableRequest request, EntityBean bean) throws SQLException {

    EntityBean assocBean = (EntityBean)assocOne.getValue(bean);
    Object boundValue = importedId.bind(request, assocBean);
    if (boundValue == null && assocBean != null) {
      // this is the scenario for a derived foreign key
      // which will require an additional update
      // register for post insert of assocBean
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    }

    public void dmlBind(BindableRequest bindRequest, EntityBean bean) throws SQLException {

      // get the embedded bean
      EntityBean embBean = (EntityBean)embProp.getValue(bean);
      if (embBean == null) {
        for (int i = 0; i < items.length; i++) {
          items[i].dmlBind(bindRequest, null);
        }
      } else {
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

          + " I expect that the concatinated key was null, and this bean does"
          + " not have ManyToOne assoc beans matching the primary key columns?";
      throw new PersistenceException(m);
    }

    EntityBean bean = persist.getEntityBean();

    // populate it from the assoc one id values...
    for (int i = 0; i < matches.length; i++) {
      matches[i].populate(bean, bean);
    }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

          naturalKey = prop.getValue(bean);
        }
      }
    }

    EntityBean sharableBean = createSharableBean(desc, bean, ebi);

    return new CachedBeanData(sharableBean, loaded, data, naturalKey, null);
  }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    if (beanEbi.isReadOnly()) {
      return bean;
    }
   
    // create a readOnly sharable instance by copying the data
    EntityBean sharableBean = desc.createEntityBean();
    BeanProperty idProp = desc.getIdProperty();
    if (idProp != null) {
      Object v = idProp.getValue(bean);
      idProp.setValue(sharableBean, v);
    }
    BeanProperty[] propertiesNonTransient = desc.propertiesNonTransient();
    for (int i = 0; i < propertiesNonTransient.length; i++) {
      Object v = propertiesNonTransient[i].getValue(bean);
      propertiesNonTransient[i].setValue(sharableBean, v);
    }
    EntityBeanIntercept intercept = sharableBean._ebean_intercept();
    intercept.setReadOnly(true);
    intercept.setLoaded();
    return sharableBean;
  }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    // do nothing (id not changing)
  }

  public void dmlBind(BindableRequest request, EntityBean bean) throws SQLException {

    EntityBean idValue = (EntityBean)embId.getValue(bean);

    for (int i = 0; i < props.length; i++) {

      Object value = props[i].getValue(idValue);
      request.bind(value, props[i], props[i].getDbColumn());
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

          + " I expect that the concatinated key was null, and this bean does"
          + " not have ManyToOne assoc beans matching the primary key columns?";
      throw new PersistenceException(m);
    }

    EntityBean bean = persist.getEntityBean();

    // create the new id
    EntityBean newId = (EntityBean)embId.createEmbeddedId();

    // populate it from the assoc one id values...
    for (int i = 0; i < matches.length; i++) {
      matches[i].populate(bean, newId);
    }
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.