Package org.openxava.calculators
Class DescriptionsCalculator
java.lang.Object
org.openxava.calculators.DescriptionsCalculator
- All Implemented Interfaces:
Serializable,ICalculator
It obtain a description collection.
Use tab infrastructure for it, so you can make that this execute within a EJB server or nor configuring tab in xava.properties.
- Author:
- Javier Paniza
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionImplementation of ICalculator interface.Finds a specific description by key without loading all data.Returns descriptions using on-demand loading with a default pagination window.getDescriptions(int limit, int offset) Returns a paginated collection of descriptions with database-level LIMIT and OFFSET.getDescriptions(int limit, int offset, String searchTerm) Returns a paginated collection of descriptions with database-level LIMIT and OFFSET.intReturns the total count of descriptions without loading the actual data.getDescriptionsWithSelected(String fvalue) It's used when there are more than one property that it's key, or with only one It's preferred use a wrapper class as primary key.It's used when there is only a key property.getModel()getOrder()Collection<?>booleanbooleanTo allow not duplicated results.booleanbooleanvoidsetCondition(String condition) voidsetDescriptionProperties(String string) voidsetDescriptionProperty(String descriptionProperty) voidsetDistinct(boolean distinct) To allow not duplicated results.voidsetKeyProperties(String keyProperties) voidsetKeyProperty(String keyProperty) voidvoidvoidsetOrderByKey(boolean b) voidvoidsetParameters(Collection<?> parameters) voidsetParameters(Collection<?> parameters, IFilter filter) voidsetUseConvertersInKeys(boolean b)
-
Constructor Details
-
DescriptionsCalculator
public DescriptionsCalculator()
-
-
Method Details
-
calculate
Implementation of ICalculator interface. Uses the new paginated approach for compatibility.- Specified by:
calculatein interfaceICalculator- Throws:
Exception
-
getDescriptions
Returns descriptions using on-demand loading with a default pagination window.- Returns:
- Collection of KeyAndDescription. Not null.
- Throws:
Exception
-
getDescriptions
Returns a paginated collection of descriptions with database-level LIMIT and OFFSET. This method bypasses cache to ensure fresh data for pagination.- Parameters:
limit- Maximum number of records to returnoffset- Number of records to skip- Returns:
- Collection of KeyAndDescription. Not null.
- Throws:
Exception- Since:
- 7.6
-
getDescriptions
public Collection<KeyAndDescription> getDescriptions(int limit, int offset, String searchTerm) throws Exception Returns a paginated collection of descriptions with database-level LIMIT and OFFSET. This method bypasses cache to ensure fresh data for pagination.- Parameters:
limit- Maximum number of records to returnoffset- Number of records to skipsearchTerm- Term to search for in description properties- Returns:
- Collection of KeyAndDescription objects matching the search term
- Throws:
Exception- if there's an error executing the query
-
getDescriptionsCount
Returns the total count of descriptions without loading the actual data. Used to determine if remote mode should be activated.- Returns:
- Total count of descriptions
- Throws:
Exception- Since:
- 7.6
-
findDescriptionByKey
Finds a specific description by key without loading all data. Used in remote mode to get the selected item description.- Parameters:
key- The key to search for- Returns:
- KeyAndDescription if found, null otherwise
- Throws:
Exception- Since:
- 7.6
-
getDescriptionsWithSelected
- Throws:
Exception
-
getKeyProperty
It's used when there is only a key property. It's exclusive with keyProperties. -
getDescriptionProperty
-
setKeyProperty
-
setDescriptionProperty
-
getModel
-
setModel
-
getCondition
-
setCondition
-
hasParameters
public boolean hasParameters() -
getParameters
-
setParameters
-
setParameters
- Throws:
FilterException
-
getKeyProperties
It's used when there are more than one property that it's key, or with only one It's preferred use a wrapper class as primary key.It's exclusive with keyProperties.
-
setKeyProperties
-
isOrderByKey
public boolean isOrderByKey() -
setOrderByKey
public void setOrderByKey(boolean b) -
setOrderByKey
-
getDescriptionProperties
-
setDescriptionProperties
-
isUseConvertersInKeys
public boolean isUseConvertersInKeys() -
setUseConvertersInKeys
public void setUseConvertersInKeys(boolean b) -
getOrder
-
setOrder
-
isDistinct
public boolean isDistinct()To allow not duplicated results.- Since:
- 7.0.3
-
setDistinct
public void setDistinct(boolean distinct) To allow not duplicated results.- Since:
- 7.0.3
-