Examples of EntityBean


Examples of com.avaje.ebean.bean.EntityBean

              request.bind(null, imported[i].foreignProperty, imported[i].localDbColumn);
          }
      }
     
    } else {
      EntityBean embedded = (EntityBean)embeddedId;
      for (int i = 0; i < imported.length; i++) {
          if (imported[i].owner.isUpdateable()) {
            Object scalarValue = imported[i].foreignProperty.getValue(embedded);
            request.bind(scalarValue, imported[i].foreignProperty, imported[i].localDbColumn);
          }
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    return null;
  }

  public void buildImport(IntersectionRow row, EntityBean other){
   
    EntityBean embeddedId = (EntityBean)foreignAssocOne.getValue(other);
    if (embeddedId == null){
      String msg = "Foreign Key value null?";
      throw new PersistenceException(msg);
    }
   
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

  /**
   * Bind the request based on the concurrency mode.
   */
  public void bind(PersistRequestBean<?> persist, DmlHandler bind, SpiUpdatePlan updatePlan) throws SQLException {

    EntityBean bean = persist.getEntityBean();

    updatePlan.bindSet(bind, bean);

    id.dmlBind(bind, bean);

View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

  /**
   * Bind the request based on the concurrency mode.
   */
  public void bind(PersistRequestBean<?> persist, DmlHandler bind) throws SQLException {

    EntityBean bean = persist.getEntityBean();

    id.dmlBind(bind, bean);

    switch (persist.getConcurrencyMode()) {
    case VERSION:
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

  @Test
  public void testEmbeddedUpdateEmbeddedProperty() {
   
    EMain emain = new EMain();

    EntityBean eb = (EntityBean)emain;
    EntityBeanIntercept ebi = eb._ebean_getIntercept();

    emain.setId(1);
    emain.setName("foo");
    Eembeddable embeddable = setEmbeddedBean(emain, "bar");
    setEmbeddedLoaded(embeddable);
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

  @Test
  public void testEmbeddedUpdateSetNewBean() {
   
    EMain emain = new EMain();

    EntityBean eb = (EntityBean)emain;
    EntityBeanIntercept ebi = eb._ebean_getIntercept();

    emain.setId(1);
    emain.setName("foo");
    Eembeddable embeddable = setEmbeddedBean(emain, "bar");
    setEmbeddedLoaded(embeddable);
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    Eembeddable embeddable = new Eembeddable();
    embeddable.setDescription(description);
   
    emain.setEmbeddable(embeddable);
   
    EntityBean owner = (EntityBean)emain;
    EntityBeanIntercept ebi= owner._ebean_getIntercept();
   
    // hooks the embeddable bean back to the owner
    int embeddablePropertyIndex = ebi.findProperty("embeddable");
    Assert.assertTrue(embeddablePropertyIndex > -1);
    ((EntityBean)embeddable)._ebean_getIntercept().setEmbeddedOwner(owner, embeddablePropertyIndex);
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

  @Test
  public void test() {
   
    PFile persistentFile = new PFile("test.txt", new PFileContent("test".getBytes()));

    EntityBean eb = (EntityBean)persistentFile;
    EntityBeanIntercept ebi = eb._ebean_getIntercept();
   
    int namePos = ebi.findProperty("name");
    int fileContentPos = ebi.findProperty("fileContent");
   
    Assert.assertTrue(ebi.isLoadedProperty(namePos));
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

    // Note1 that the enhancement ClassAdapterEntity line 239 makes a default constructor publically accessible
    // Note2 the ClassAdpater will call DefaultConstructor.add() to add a default constructor if it doesn't exist
   
   
    EntityBean entityBean = (EntityBean)bean;
    Object newBeanInstance = entityBean._ebean_newInstance();
   
    Assert.assertNotNull(newBeanInstance);
    BeanState beanState = Ebean.getBeanState(newBeanInstance);
    Assert.assertTrue(beanState.isNew());
    Assert.assertNotSame(entityBean, newBeanInstance);
View Full Code Here

Examples of com.avaje.ebean.bean.EntityBean

        Assert.assertEquals(new Money("12200"), bean.getSalary());
        Assert.assertEquals(new Money("12"), bean.getCmoney().getAmount());
        Assert.assertEquals(NZD, bean.getCmoney().getCurrency());
       
       
        EntityBean entityBean = (EntityBean)p;
       
        Object cmoney = elCmoney.elGetValue(entityBean);
//        Object amt = elCmoneyAmt.elGetValue(entityBean);
//        Object cur = elCmoneyCur.elGetValue(entityBean);
       
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.