// assemble sql
StringBuffer sql = (StringBuffer) data;
if(selectManager.getMetaData().hasRowLocking() && !(selectObject instanceof SelectFunction))
{
JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
if(rowLockingTemplate == null)
{
throw new IllegalStateException("Row locking template is not defined for given mapping: " + typeMapping.getName());
}
boolean distinct = selectDistinct;
Object args[] = new Object[]{
distinct ? SQLUtil.DISTINCT + selectClause : selectClause.toString(),
fromClause,
whereClause == null || whereClause.length() == 0 ? null : whereClause,
orderByClause == null || orderByClause.length() == 0 ? null : orderByClause
};
rowLockingTemplate.getFunctionSql(args, sql);
}
else
{
sql.append(SQLUtil.SELECT);
if(selectDistinct)