Package ubic.gemma.persistence.util
Class Sort
- java.lang.Object
-
- ubic.gemma.persistence.util.Sort
-
- All Implemented Interfaces:
PropertyMapping
public class Sort extends Object implements PropertyMapping
Represents a directed sort by a property.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSort.DirectionDirection of the sort.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SortandThen(Sort andThen)Add a next sort.static Sortby(String alias, String propertyName, Sort.Direction direction)Create a sort without an original property.static Sortby(String alias, String propertyName, Sort.Direction direction, String originalProperty)Create aSortfor a given alias, property and direction.StringtoOriginalString()Render this with its original property.StringtoString()Render this with itsPropertyMapping.getObjectAlias()andPropertyMapping.getPropertyName().-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.util.PropertyMapping
getObjectAlias, getOriginalProperty, getPropertyName
-
-
-
-
Method Detail
-
by
public static Sort by(@Nullable String alias, String propertyName, @Nullable Sort.Direction direction, String originalProperty)
Create aSortfor a given alias, property and direction.- Parameters:
alias- an alias in the query, or null to refer to the root entity (not recommended though, since this could result in an ambiguous query)propertyName- a property of objectAlias to order bydirection- a direction, or null for defaultoriginalProperty- an original property name for rendering viatoOriginalString()
-
by
public static Sort by(@Nullable String alias, String propertyName, @Nullable Sort.Direction direction)
Create a sort without an original property.- See Also:
by(String, String, Direction)
-
toString
public String toString()
Description copied from interface:PropertyMappingRender this with itsPropertyMapping.getObjectAlias()andPropertyMapping.getPropertyName().- Specified by:
toStringin interfacePropertyMapping- Overrides:
toStringin classObject
-
toOriginalString
public String toOriginalString()
Description copied from interface:PropertyMappingRender this with its original property.If no original property are attached to this mapping, this method should return the same as
PropertyMapping.toString().- Specified by:
toOriginalStringin interfacePropertyMapping
-
-