* @throws SQLException
*/
private int bindStatementValue(PreparedStatement stmt, int index, Object attributeOrQuery, Object value, ClassDescriptor cld)
throws SQLException
{
FieldDescriptor fld = null;
// if value is a subQuery bind it
if (value instanceof Query)
{
Query subQuery = (Query) value;
return bindStatement(stmt, subQuery, cld.getRepository().getDescriptorFor(subQuery.getSearchClass()), index);
}
// if attribute is a subQuery bind it
if (attributeOrQuery instanceof Query)
{
Query subQuery = (Query) attributeOrQuery;
bindStatement(stmt, subQuery, cld.getRepository().getDescriptorFor(subQuery.getSearchClass()), index);
}
else
{
fld = cld.getFieldDescriptorForPath((String) attributeOrQuery);
}
if (fld != null)
{
// BRJ: use field conversions and platform
if (value != null)
{
m_platform.setObjectForStatement(stmt, index, fld.getFieldConversion().javaToSql(value), fld.getJdbcType().getType());
}
else
{
m_platform.setNullForStatement(stmt, index, fld.getJdbcType().getType());
}
}
else
{
if (value != null)