public class DistinctCountSQLValue extends java.lang.Object implements GroupingSQLValue<DistinctCount>
SQLValue
that generates an DistinctCount
This is intended to be used in group by queries in conjunction with
a group-by clause on the nested GroupingSQLValue
.
The SQL fragment is therefore the same as the nested value
but the result in wrapped in a DistinctCount
Constructor and Description |
---|
DistinctCountSQLValue(GroupingSQLValue value) |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.StringBuilder sb,
boolean qualify)
Add the expression to a StringBuilder
|
int |
addGroup(java.lang.StringBuilder sb,
boolean qualify)
Add the group-by clause to a query.
|
boolean |
checkContentsCanGroup()
return false if this instance is not able to perform grouping.
|
java.util.List<PatternArgument> |
getGroupParameters(java.util.List<PatternArgument> list)
Get the parameters for a group-by clause.
|
java.util.List<PatternArgument> |
getParameters(java.util.List<PatternArgument> list)
Add parameters for this value to a list.
|
SQLFilter |
getRequiredFilter()
Get an SQLFilter required to be added to the filter set.
|
java.lang.Class<DistinctCount> |
getTarget()
Get the type of the returned object as far as it is known.
|
DistinctCount |
makeObject(java.sql.ResultSet rs,
int pos)
Extract a result of the expression from a ResultSet into an object of the specified type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
groupingIsomorphic
public DistinctCountSQLValue(GroupingSQLValue value)
public java.lang.Class<DistinctCount> getTarget()
Targetted
getTarget
in interface Targetted<DistinctCount>
public int add(java.lang.StringBuilder sb, boolean qualify)
SQLValue
add
in interface SQLValue<DistinctCount>
sb
- StringBuilder to modifyqualify
- boolean should fields be qualified with the table namepublic java.util.List<PatternArgument> getParameters(java.util.List<PatternArgument> list)
SQLValue
getParameters
in interface SQLValue<DistinctCount>
list
- to modifypublic DistinctCount makeObject(java.sql.ResultSet rs, int pos) throws DataException, java.sql.SQLException
SQLValue
makeObject
in interface SQLValue<DistinctCount>
rs
- ResultSetDataException
java.sql.SQLException
public SQLFilter getRequiredFilter()
SQLValue
getRequiredFilter
in interface SQLValue<DistinctCount>
public int addGroup(java.lang.StringBuilder sb, boolean qualify)
GroupingSQLValue
addGroup
in interface GroupingSQLValue<DistinctCount>
public java.util.List<PatternArgument> getGroupParameters(java.util.List<PatternArgument> list)
GroupingSQLValue
getGroupParameters
in interface GroupingSQLValue<DistinctCount>
public boolean checkContentsCanGroup()
GroupingSQLValue
checkContentsCanGroup
in interface GroupingSQLValue<DistinctCount>