Package org.openxava.calculators
Class DescriptionsCalculator
- java.lang.Object
-
- org.openxava.calculators.DescriptionsCalculator
-
- All Implemented Interfaces:
java.io.Serializable,ICalculator
public class DescriptionsCalculator extends java.lang.Object implements 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DescriptionsCalculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectcalculate()Implementation of ICalculator interface.KeyAndDescriptionfindDescriptionByKey(java.lang.Object key)Finds a specific description by key without loading all data.java.lang.StringgetCondition()java.lang.StringgetDescriptionProperties()java.lang.StringgetDescriptionProperty()java.util.Collection<KeyAndDescription>getDescriptions()Returns descriptions using on-demand loading with a default pagination window.java.util.Collection<KeyAndDescription>getDescriptions(int limit, int offset)Returns a paginated collection of descriptions with database-level LIMIT and OFFSET.java.util.Collection<KeyAndDescription>getDescriptions(int limit, int offset, java.lang.String searchTerm)Returns a paginated collection of descriptions with database-level LIMIT and OFFSET.intgetDescriptionsCount()Returns the total count of descriptions without loading the actual data.java.util.Collection<KeyAndDescription>getDescriptionsWithSelected(java.lang.String fvalue)java.lang.StringgetKeyProperties()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.java.lang.StringgetKeyProperty()It's used when there is only a key property.java.lang.StringgetModel()java.lang.StringgetOrder()java.util.Collection<?>getParameters()booleanhasParameters()booleanisDistinct()To allow not duplicated results.booleanisOrderByKey()booleanisUseConvertersInKeys()voidsetCondition(java.lang.String condition)voidsetDescriptionProperties(java.lang.String string)voidsetDescriptionProperty(java.lang.String descriptionProperty)voidsetDistinct(boolean distinct)To allow not duplicated results.voidsetKeyProperties(java.lang.String keyProperties)voidsetKeyProperty(java.lang.String keyProperty)voidsetModel(java.lang.String model)voidsetOrder(java.lang.String order)voidsetOrderByKey(boolean b)voidsetOrderByKey(java.lang.String b)voidsetParameters(java.util.Collection<?> parameters)voidsetParameters(java.util.Collection<?> parameters, IFilter filter)voidsetUseConvertersInKeys(boolean b)
-
-
-
Method Detail
-
calculate
public java.lang.Object calculate() throws java.lang.ExceptionImplementation of ICalculator interface. Uses the new paginated approach for compatibility.- Specified by:
calculatein interfaceICalculator- Throws:
java.lang.Exception
-
getDescriptions
public java.util.Collection<KeyAndDescription> getDescriptions() throws java.lang.Exception
Returns descriptions using on-demand loading with a default pagination window.- Returns:
- Collection of KeyAndDescription. Not null.
- Throws:
java.lang.Exception
-
getDescriptions
public java.util.Collection<KeyAndDescription> getDescriptions(int limit, int offset) throws java.lang.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 skip- Returns:
- Collection of KeyAndDescription. Not null.
- Throws:
java.lang.Exception- Since:
- 7.6
-
getDescriptions
public java.util.Collection<KeyAndDescription> getDescriptions(int limit, int offset, java.lang.String searchTerm) throws java.lang.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:
java.lang.Exception- if there's an error executing the query
-
getDescriptionsCount
public int getDescriptionsCount() throws java.lang.ExceptionReturns 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:
java.lang.Exception- Since:
- 7.6
-
findDescriptionByKey
public KeyAndDescription findDescriptionByKey(java.lang.Object key) throws java.lang.Exception
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:
java.lang.Exception- Since:
- 7.6
-
getDescriptionsWithSelected
public java.util.Collection<KeyAndDescription> getDescriptionsWithSelected(java.lang.String fvalue) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getKeyProperty
public java.lang.String getKeyProperty()
It's used when there is only a key property. It's exclusive with keyProperties.
-
getDescriptionProperty
public java.lang.String getDescriptionProperty()
-
setKeyProperty
public void setKeyProperty(java.lang.String keyProperty)
-
setDescriptionProperty
public void setDescriptionProperty(java.lang.String descriptionProperty)
-
getModel
public java.lang.String getModel()
-
setModel
public void setModel(java.lang.String model)
-
getCondition
public java.lang.String getCondition()
-
setCondition
public void setCondition(java.lang.String condition)
-
hasParameters
public boolean hasParameters()
-
getParameters
public java.util.Collection<?> getParameters()
-
setParameters
public void setParameters(java.util.Collection<?> parameters)
-
setParameters
public void setParameters(java.util.Collection<?> parameters, IFilter filter) throws FilterException- Throws:
FilterException
-
getKeyProperties
public java.lang.String 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
public void setKeyProperties(java.lang.String keyProperties)
-
isOrderByKey
public boolean isOrderByKey()
-
setOrderByKey
public void setOrderByKey(boolean b)
-
setOrderByKey
public void setOrderByKey(java.lang.String b)
-
getDescriptionProperties
public java.lang.String getDescriptionProperties()
-
setDescriptionProperties
public void setDescriptionProperties(java.lang.String string)
-
isUseConvertersInKeys
public boolean isUseConvertersInKeys()
-
setUseConvertersInKeys
public void setUseConvertersInKeys(boolean b)
-
getOrder
public java.lang.String getOrder()
-
setOrder
public void setOrder(java.lang.String order)
-
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
-
-