org.springframework.roo.addon.finder
Interface DynamicFinderServices

All Known Implementing Classes:
DynamicFinderServicesImpl

public interface DynamicFinderServices

The DynamicFinderServices is used for the generation of "dynamic finder" methods based on a JavaSymbolName which would look like 'findByFirstNameAndLastName'. This class will suggest possible finder combinations, create a query String and provide access to parameter types and names.

Since:
1.0
Author:
Ben Alex, Stefan Schmidt

Method Summary
 List<org.springframework.roo.model.JavaSymbolName> getFindersFor(org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata, String plural, int maxDepth)
          This method provides a convenient generator for all possible combinations of finder method signatures.
 String getJpaQueryFor(org.springframework.roo.model.JavaSymbolName finderName, String plural, org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
          This method generates a named JPA query String to be used in JPA entity manager queries.
 List<org.springframework.roo.model.JavaSymbolName> getParameterNames(org.springframework.roo.model.JavaSymbolName finderName, String plural, org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
          This method should be used in combination with #getJpaQueryFor(JavaSymbolName, BeanInfoMetadata) in order to find out about the parameter names used in the named JPA query.
 List<org.springframework.roo.model.JavaType> getParameterTypes(org.springframework.roo.model.JavaSymbolName finderName, String plural, org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
          This method should be used in combination with JPA entity manager queries in order to find out about the parameter types used in the named JPA query.
 

Method Detail

getFindersFor

List<org.springframework.roo.model.JavaSymbolName> getFindersFor(org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata,
                                                                 String plural,
                                                                 int maxDepth)
This method provides a convenient generator for all possible combinations of finder method signatures.

Parameters:
beanInfoMetadata - the metadata for the BeanInfoMetadata for which the finder signatures combinations are generated. (required)
plural - the pluralised form of the entity name, which is used for finder method names (required)
maxDepth - the depth of combinations used for finder signatures combinations (a depth of 2 will combine a maximum of two attributes from the BeanInfoMetadata (required)
Returns:
all possible finder method signatures for the given depth.

getJpaQueryFor

String getJpaQueryFor(org.springframework.roo.model.JavaSymbolName finderName,
                      String plural,
                      org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
This method generates a named JPA query String to be used in JPA entity manager queries.

Parameters:
finderName - the finder method signature to use. Must be a valid signature. (required)
beanInfoMetadata - the metadata for the BeanInfoMetadata for which the finder signatures combinations were generated. (required)
Returns:
the String to be used in a JPA named query

getParameterTypes

List<org.springframework.roo.model.JavaType> getParameterTypes(org.springframework.roo.model.JavaSymbolName finderName,
                                                               String plural,
                                                               org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
This method should be used in combination with JPA entity manager queries in order to find out about the parameter types used in the named JPA query.

Parameters:
finderName - the finder method signature to use. Must be a valid signature. (required)
beanInfoMetadata - the metadata for the BeanInfoMetadata for which the finder signatures combinations were generated. (required)
Returns:
the JavaType array representing the parameter types for the finder method signature presented

getParameterNames

List<org.springframework.roo.model.JavaSymbolName> getParameterNames(org.springframework.roo.model.JavaSymbolName finderName,
                                                                     String plural,
                                                                     org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
This method should be used in combination with #getJpaQueryFor(JavaSymbolName, BeanInfoMetadata) in order to find out about the parameter names used in the named JPA query.

Parameters:
finderName - the finder method signature to use. Must be a valid signature. (required)
beanInfoMetadata - the metadata for the BeanInfoMetadata for which the finder signatures combinations were generated. (required)
Returns:
the JavaSymbolName array representing the parameter names for the finder method signature presented


Copyright © 2009-2010 VMware, Inc. All Rights Reserved.