Examples of ElPropertyValue


Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

  @Test
  public void test() {

    SpiEbeanServer server = (SpiEbeanServer) Ebean.getServer(null);
    BeanDescriptor<Order> d = server.getBeanDescriptor(Order.class);
    ElPropertyValue elGetValue = d.getElGetValue("customer.contacts");

    Assert.assertTrue(elGetValue.containsMany());

    ResetBasicData.reset();

    List<Order> list = Ebean.find(Order.class)
        .fetch("customer")
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

   
    synchronized(monitor){
             
      BeanDescriptor<?> desc = rootDesc;
      if (path != null){
        ElPropertyValue elGetValue = rootDesc.getElGetValue(path);
        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();
          }
        }
      }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

    addDateTime(propertyName, dateTimeFormat, Locale.getDefault());
  }

  public void addDateTime(String propertyName, String dateTimeFormat, Locale locale) {

    ElPropertyValue elProp = descriptor.getElGetValue(propertyName);
    if (!elProp.isDateTimeCapable()) {
      throw new TextException("Property " + propertyName + " is not DateTime capable");
    }

    if (dateTimeFormat == null) {
      dateTimeFormat = getDefaultDateTimeFormat(elProp.getJdbcType());
    }

    if (locale == null) {
      locale = defaultLocale;
    }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

    }
  }

  public void addProperty(String propertyName, StringParser parser) {

    ElPropertyValue elProp = descriptor.getElGetValue(propertyName);
    if (parser == null) {
      parser = elProp.getStringParser();
    }
    CsvColumn column = new CsvColumn(elProp, parser);
    columnList.add(column);
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

    }
  }

  private void addPropertiesFromHeader(String[] line) {
    for (int i = 0; i < line.length; i++) {
      ElPropertyValue elProp = descriptor.getElGetValue(line[i]);
      if (elProp == null) {
        throw new TextException("Property [" + line[i] + "] not found");
      }

      if (Types.TIME == elProp.getJdbcType()) {
        addProperty(line[i], TIME_PARSER);

      } else if (isDateTimeType(elProp.getJdbcType())) {
        addDateTime(line[i], null, null);

      } else if (elProp.isAssocProperty()) {
        BeanPropertyAssocOne<?> assocOne = (BeanPropertyAssocOne<?>) elProp.getBeanProperty();
        String idProp = assocOne.getBeanDescriptor().getIdBinder().getIdProperty();
        addProperty(line[i] + "." + idProp);
      } else {
        addProperty(line[i]);
      }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

    this.value = value.toLowerCase();
  }

  public void addBindValues(SpiExpressionRequest request) {

    ElPropertyValue prop = getElProp(request);
    if (prop != null && prop.isDbEncrypted()) {
      // bind the key as well as the value
      String encryptKey = prop.getBeanProperty().getEncryptKey().getStringValue();
      request.addBindValue(encryptKey);
    }

    request.addBindValue(value);
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

  public void addSql(SpiExpressionRequest request) {

    String propertyName = getPropertyName();
    String pname = propertyName;

    ElPropertyValue prop = getElProp(request);
    if (prop != null && prop.isDbEncrypted()) {
      pname = prop.getBeanProperty().getDecryptProperty(propertyName);
    }

    request.append("lower(").append(pname).append(") =? ");
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

   
        String propertyName = getPropertyName();

      String nullExpr = notNull ? " is not null " : " is null ";
     
      ElPropertyValue prop = getElProp(request);
        if (prop != null && prop.isAssocId()){
            request.append(prop.getAssocOneIdExpr(propertyName, nullExpr));
            return;
        }
     
    request.append(propertyName).append(nullExpr);
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

    }
    sqlTree.setIncludes(queryDetail.getIncludes());
    sqlTree.setSummary(summary.toString());

    if (manyPropertyName != null) {
      ElPropertyValue manyPropEl = desc.getElGetValue(manyPropertyName);
      sqlTree.setManyProperty(manyProperty, manyPropertyName, manyPropEl);
    }

    return sqlTree;
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.el.ElPropertyValue

    /**
     * Create a SqlTreeNodeExtraJoin, register and return it.
     */
    private SqlTreeNodeExtraJoin createJoinLeaf(String propertyName) {

      ElPropertyValue elGetValue = desc.getElGetValue(propertyName);

      if (elGetValue == null) {
        // this can occur for master detail queries
        // with concatenated keys (so not an error now)
        return null;
      }
      BeanProperty beanProperty = elGetValue.getBeanProperty();
      if (beanProperty instanceof BeanPropertyAssoc<?>) {
        BeanPropertyAssoc<?> assocProp = (BeanPropertyAssoc<?>) beanProperty;
        if (assocProp.isEmbedded()) {
          // no extra join required for embedded beans
          return null;
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.