Package com.anasoft.os.daofusion.criteria

Examples of com.anasoft.os.daofusion.criteria.NestedPropertyCriteria$DefaultNestedPropertyCriterionVisitor


 
    /**
   * @see com.anasoft.os.daofusion.PersistentEntityDao#getAll(java.lang.Class)
   */
  public <S extends T> List<S> getAll(Class<S> targetEntityClass) {
    return query(new NestedPropertyCriteria(), targetEntityClass);
  }
View Full Code Here


 
  /**
   * @see com.anasoft.os.daofusion.PersistentEntityDao#countAll(java.lang.Class)
   */
  public <S extends T> int countAll(Class<S> targetEntityClass) {
      return count(new NestedPropertyCriteria(), targetEntityClass);
  }
View Full Code Here

   *
   * @return {@link NestedPropertyCriteria} instance to hold
   * criteria from the criteria transfer object.
   */
  protected NestedPropertyCriteria createCriteria() {
      return new NestedPropertyCriteria();
  }
View Full Code Here

 
  /**
   * @see com.anasoft.os.daofusion.cto.server.CriteriaTransferObjectConverter#convert(com.anasoft.os.daofusion.cto.client.CriteriaTransferObject, java.lang.String)
   */
  public PersistentEntityCriteria convert(CriteriaTransferObject transferObject, String mappingGroupName) {
    NestedPropertyCriteria nestedCriteria = createCriteria();
   
    Set<String> propertyIdSet = transferObject.getPropertyIdSet();
    Map<String, List<NestedPropertyMapping>> propertyMappings = getPropertyMappings(mappingGroupName);
   
    if (propertyMappings != null) {
        for (String propertyId : propertyIdSet) {
            FilterAndSortCriteria clientSideCriteria = transferObject.get(propertyId);
            List<NestedPropertyMapping> mappingList = propertyMappings.get(propertyId);
               
            if (mappingList != null) {
                for (NestedPropertyMapping mapping : mappingList) {
                    LOG.info("Applying property mapping for propertyId '{}' within the mapping group '{}'", propertyId, mappingGroupName);
                    mapping.apply(clientSideCriteria, nestedCriteria);
                }
            } else {
                LOG.warn("No mappings found for propertyId '{}' within the mapping group '{}' - skipping property conversion", propertyId, mappingGroupName);
            }
        }
    } else {
        LOG.warn("Requested property mapping group '{}' not found - did you forget to add mappings for this one?", mappingGroupName);
    }
   
    nestedCriteria.setFirstResult(transferObject.getFirstResult());
    nestedCriteria.setMaxResults(transferObject.getMaxResults());
   
    return nestedCriteria;
  }
View Full Code Here

TOP

Related Classes of com.anasoft.os.daofusion.criteria.NestedPropertyCriteria$DefaultNestedPropertyCriterionVisitor

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.