org.springframework.roo.addon.finder
Class DynamicFinderServicesImpl

java.lang.Object
  extended by org.springframework.roo.addon.finder.DynamicFinderServicesImpl
All Implemented Interfaces:
DynamicFinderServices

public class DynamicFinderServicesImpl
extends Object
implements DynamicFinderServices

Default implementation of DynamicFinderServices.

Since:
1.0
Author:
Stefan Schmidt

Constructor Summary
DynamicFinderServicesImpl()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicFinderServicesImpl

public DynamicFinderServicesImpl()
Method Detail

getFindersFor

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

Specified by:
getFindersFor in interface DynamicFinderServices
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

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

Specified by:
getJpaQueryFor in interface DynamicFinderServices
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

getParameterNames

public List<org.springframework.roo.model.JavaSymbolName> getParameterNames(org.springframework.roo.model.JavaSymbolName finderName,
                                                                            String plural,
                                                                            org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
Description copied from interface: DynamicFinderServices
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.

Specified by:
getParameterNames in interface DynamicFinderServices
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

getParameterTypes

public List<org.springframework.roo.model.JavaType> getParameterTypes(org.springframework.roo.model.JavaSymbolName finderName,
                                                                      String plural,
                                                                      org.springframework.roo.addon.beaninfo.BeanInfoMetadata beanInfoMetadata)
Description copied from interface: DynamicFinderServices
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.

Specified by:
getParameterTypes in interface DynamicFinderServices
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


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