Examples of BeanProperty


Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

        if (elGetValue == null){
          desc = null;
          logger.warn("Autofetch: Can't find join for path["+path+"] for "+rootDesc.getName());
         
        } else {
          BeanProperty beanProperty = elGetValue.getBeanProperty();
          if (beanProperty instanceof BeanPropertyAssoc<?>){
            desc = ((BeanPropertyAssoc<?>) beanProperty).getTargetDescriptor();
          }
        }
      }

      for (String propName : aggregateUsed) {
                BeanProperty beanProp = desc.getBeanPropertyFromPath(propName);
                if (beanProp == null){
                    logger.warn("Autofetch: Can't find property["+propName+"] for "+desc.getName());
                   
                } else {
                    if (beanProp instanceof BeanPropertyAssoc<?>){
                        BeanPropertyAssoc<?> assocProp = (BeanPropertyAssoc<?>)beanProp;
                        String targetIdProp = assocProp.getTargetIdProperty();
                        String manyPath = SplitName.add(path, assocProp.getName());
                        pathProps.addToPath(manyPath, targetIdProp);
                    } else {
                      if (beanProp.isLob() && !beanProp.isFetchEager()) {
                        // AutoFetch will not include Lob's marked FetchLazy
                        // (which is the default for Lob's so typical).
                      } else {
                        pathProps.addToPath(path, beanProp.getName());
                      }
                    }
                }
            }

            if ((modified || queryTuningAddVersion) && desc != null) {
                BeanProperty versionProp = desc.getVersionProperty();
                if (versionProp != null) {
                    pathProps.addToPath(path, versionProp.getName());
                }
            }
    }
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

  /**
   * Create a Bindable for the version property(s) for a bean type.
   */
  public Bindable create(BeanDescriptor<?> desc) {

     BeanProperty versionProperty = desc.getVersionProperty();
     if (versionProperty == null) {
       return null;
     }
    
     return new BindableProperty(versionProperty);    
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

  public static boolean load(BeanDescriptor<?> desc, EntityBean bean, CachedBeanData cacheBeanData) {
   
    EntityBeanIntercept ebi = bean._ebean_getIntercept();

   
    BeanProperty idProperty = desc.getIdProperty();
    if (idProperty != null) {
      // load the id property
      loadProperty(bean, cacheBeanData, ebi, idProperty);
    }
   
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

  /**
   * Add uniqueId properties.
   */
  public BindableId createId(BeanDescriptor<?> desc) {

    BeanProperty id = desc.getIdProperty();
    if (id == null) {
      return new BindableIdEmpty();

    }    
    if (!id.isEmbedded()) {
      return new BindableIdScalar(id);

    } else {
      BeanPropertyAssocOne<?> embId = (BeanPropertyAssocOne<?>) id;
      return new BindableIdEmbedded(embId, desc);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

    EntityBeanIntercept ebi = bean._ebean_getIntercept();
   
    Object[] data = new Object[desc.getPropertyCount()];
    boolean[] loaded = new boolean[desc.getPropertyCount()];
   
    BeanProperty idProperty = desc.getIdProperty();
    if (idProperty != null) {
      int propertyIndex = idProperty.getPropertyIndex();
      if (ebi.isLoadedProperty(propertyIndex)) {
        // extract the id property value
        data[propertyIndex] = idProperty.getCacheDataValue(bean);
        loaded[propertyIndex] = true;
      }
    }
    BeanProperty[] props = desc.propertiesNonMany();

    Object naturalKey = null;

    // extract all the non-many properties
    for (int i = 0; i < props.length; i++) {
      BeanProperty prop = props[i];
      if (ebi.isLoadedProperty(prop.getPropertyIndex())) {
        int propertyIndex = prop.getPropertyIndex();
        data[propertyIndex] = prop.getCacheDataValue(bean);
        loaded[propertyIndex] = true;
        if (prop.isNaturalKey()) {
          naturalKey = prop.getValue(bean);
        }
      }
    }

    EntityBean sharableBean = createSharableBean(desc, bean, ebi);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

      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);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

        String constraint = createUniqueConstraint(table, i, compoundUniqueConstraints[i]);
        ctx.write("  ").write(constraint).write(",").writeNewLine();
      }
    }

    BeanProperty idProp = descriptor.getIdProperty();

    if (idProp == null) {
      // No comma + new line
      ctx.removeLast().removeLast();
    } else if (ddl.isInlinePrimaryKeyConstraint()) {
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

   */
  public static void visitBean(BeanDescriptor<?> desc, BeanVisitor visitor) {

    if (visitor.visitBean(desc)) {

      BeanProperty idProp = desc.getIdProperty();
      if (idProp != null) {
        visit(visitor, idProp);
      }
      BeanPropertyAssocOne<?> unidirectional = desc.getUnidirectional();
      if (unidirectional != null) {
        visit(visitor, unidirectional);
      }
      BeanProperty[] propertiesNonTransient = desc.propertiesNonTransient();
      for (int i = 0; i < propertiesNonTransient.length; i++) {
        BeanProperty p = propertiesNonTransient[i];
        if (!p.isFormula() && !p.isSecondaryTable()) {
          visit(visitor, p);
        }
      }

      visitor.visitBeanEnd(desc);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

    pkeySb.append(", ");
    pkeySb.append(column);

    writeColumn(column);

    BeanProperty p = desc.getIdBinder().findBeanProperty(findPropColumn);
    if (p == null) {
      throw new RuntimeException("Could not find id property for " + findPropColumn);
    }

    String columnDefn = ctx.getColumnDefn(p);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanProperty

      }
    }

    public void write(WriteJson writeJson) throws IOException {
     
      BeanProperty beanProp = desc.getIdProperty();
      if (beanProp != null) {
        if (isIncludeProperty(beanProp)) {
          beanProp.jsonWrite(writeJson, currentBean);
        }
      }
 
      if (!isReferenceOnly()) {
        // render all the properties and invoke lazy loading if required
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.