Package com.avaje.ebeaninternal.server.el

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


    boolean fetchJoinFirstMany = allowOne;

    sortFetchPaths(beanDescriptor);

    for (String fetchPath : fetchPaths.keySet()) {
      ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(fetchPath);
      if (elProp.containsManySince(manyFetchProperty)) {

        // this is a join to a *ToMany
        OrmQueryProperties chunk = fetchPaths.get(fetchPath);
        if (chunk.isFetchJoin() && !isLazyLoadManyRoot(lazyLoadManyPath, chunk)
            && !hasParentSecJoin(lazyLoadManyPath, chunk)) {
View Full Code Here


    return propName;
  }

  public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) {

    ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(lowProperty));
    if (elProp != null && elProp.containsMany()) {
      manyWhereJoin.add(elProp);
    }

    elProp = desc.getElPropertyDeploy(name(highProperty));
    if (elProp != null && elProp.containsMany()) {
      manyWhereJoin.add(elProp);
    }
  }
View Full Code Here

  public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) {

    String propertyName = getPropertyName();
    if (propertyName != null) {
      ElPropertyDeploy elProp = desc.getElPropertyDeploy(propertyName);
      if (elProp != null) {
        if (elProp.containsFormulaWithJoin()) {
          // for findRowCount query select clause
          manyWhereJoin.addFormulaWithJoin(propertyName);
        }
        if (elProp.containsMany()) {
          // for findRowCount we join to a many property
          manyWhereJoin.add(elProp);
        }
      }
    }
View Full Code Here

  }

  public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin) {
    if (propMap != null) {
      for (String propertyName : propMap.keySet()) {
        ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(propertyName));
        if (elProp != null && elProp.containsMany()) {
          manyWhereJoin.add(elProp);
        }
      }
    }
  }
View Full Code Here

 
    if (expression.equalsIgnoreCase(beanDescriptor.getName())){
      return beanDescriptor.getBaseTable();
    }

    ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression);
    if (elProp != null){
      return elProp.getDbColumn();
    } else {
      return null;
    }
  }
View Full Code Here

  public void testEl() {
   
    SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
    BeanDescriptor<Customer> descriptor = server.getBeanDescriptor(Customer.class);
   
    ElPropertyDeploy elId = descriptor.getElPropertyDeploy("id");
    Assert.assertTrue(elId instanceof BeanProperty);
   
    ElPropertyDeploy elBillAddress = descriptor.getElPropertyDeploy("billingAddress");
    Assert.assertTrue(elBillAddress instanceof BeanPropertyAssocOne<?>);
   
    ElPropertyDeploy elBillAddressId = descriptor.getElPropertyDeploy("billingAddress.id");
    Assert.assertTrue(elBillAddressId instanceof BeanFkeyProperty);
    Assert.assertEquals("billing_address_id", elBillAddressId.getDbColumn());
    Assert.assertEquals("billingAddress.id", elBillAddressId.getName());
    Assert.assertNull(elBillAddressId.getElPrefix());
   
   
    ElPropertyDeploy elBillAddressCity = descriptor.getElPropertyDeploy("billingAddress.city");
    Assert.assertTrue(elBillAddressCity instanceof ElPropertyChain);
    Assert.assertEquals("billingAddress",elBillAddressCity.getElPrefix());
    Assert.assertEquals("city",elBillAddressCity.getName());
    Assert.assertEquals("${billingAddress}city",elBillAddressCity.getElPlaceholder(false));
    Assert.assertEquals("city",elBillAddressCity.getDbColumn());

//    ElPropertyDeploy elBillAddressCountry = descriptor.getElPropertyDeploy("billingAddress.country");

   
    ElPropertyDeploy elOrders = descriptor.getElPropertyDeploy("orders");
    Assert.assertTrue(elOrders instanceof BeanPropertyAssocMany<?>);
   
    ElPropertyDeploy elOrderStatus = descriptor.getElPropertyDeploy("orders.status");
    Assert.assertTrue(elOrderStatus instanceof ElPropertyChain);
    Assert.assertEquals("orders",elOrderStatus.getElPrefix());
    Assert.assertEquals("status",elOrderStatus.getName());
    Assert.assertEquals("${orders}status",elOrderStatus.getElPlaceholder(false));
    Assert.assertEquals("status",elOrderStatus.getDbColumn());

    ElPropertyDeploy elOrderCust = descriptor.getElPropertyDeploy("orders.customer");
    Assert.assertTrue(elOrderCust instanceof ElPropertyChain);

    ElPropertyDeploy elOrderDetails = descriptor.getElPropertyDeploy("orders.details");
    Assert.assertTrue(elOrderDetails instanceof ElPropertyChain);

    ElPropertyDeploy elOrderDetailsId = descriptor.getElPropertyDeploy("orders.details.id");
    Assert.assertTrue(elOrderDetailsId instanceof ElPropertyChain);
   
  }
View Full Code Here

    return includes;
  }
 
  @Override
    public String getDeployWord(String expression) {
        ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(expression);
        if (elProp == null){
            return null;
        } else {
            addIncludes(elProp.getElPrefix());
            return elProp.getElPlaceholder(encrypted);
        }
    }
View Full Code Here

   * Add joins.
   */
  public void addJoin(Set<String> propJoins, BeanDescriptor<?> desc) {
    if (propJoins != null) {
      for (String propJoin : propJoins) {
        ElPropertyDeploy elProp = desc.getElPropertyDeploy(propJoin);
        if (elProp != null && elProp.getBeanProperty().isEmbedded()) {
          addEmbeddedPropertyJoin(propJoin);

        } else {
          addPropertyJoin(propJoin, joinProps);
        }
View Full Code Here

   * <p>
   * The foreign key shortcuts means we can avoid unnecessary joins.
   * </p>
   */
  public ElPropertyDeploy getElPropertyDeploy(String propName) {
    ElPropertyDeploy fk = fkeyMap.get(propName);
    if (fk != null) {
      return fk;
    }
    return getElPropertyValue(propName, true);
  }
View Full Code Here

TOP

Related Classes of com.avaje.ebeaninternal.server.el.ElPropertyDeploy

Copyright © 2018 www.massapicom. 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.