Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@
*/
public class CodeAnalyzer extends NodeVisitor {

public static final String PARAMETERIZED_QUERY = "ParameterizedQuery";
public static final String PARAMETERIZED_QUERY = "sql:ParameterizedQuery";
public static final String PARAMETERIZED_CALL_QUERY = "sql:ParameterizedCallQuery";
// Readonly fields
private final Project project;
private final SemanticModel semanticModel;
Expand Down Expand Up @@ -1391,7 +1392,8 @@ private void buildPropertyType(Property.Builder<?> builder, ParameterData paramD
builder.type(Property.ValueType.MAPPING_EXPRESSION_SET);
} else {
String ballerinaType = CommonUtils.getTypeSignature(paramData.typeSymbol(), moduleInfo);
if (ballerinaType != null && ballerinaType.contains(PARAMETERIZED_QUERY)) {
if (ballerinaType != null && (ballerinaType.contains(PARAMETERIZED_QUERY)
|| ballerinaType.contains(PARAMETERIZED_CALL_QUERY))) {
// Handle SQL query parameters with SQL_QUERY as primary option
builder.type()
.fieldType(Property.ValueType.SQL_QUERY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public record Property(Metadata metadata, List<PropertyType> types, Object value
public static final TypeToken<List<Property>> LIST_PROPERTY_TYPE_TOKEN = new TypeToken<List<Property>>() {
};
public static final String SQL_PARAMETERIZED_QUERY = "sql:ParameterizedQuery";
public static final String SQL_CALL_QUERY = "sql:ParameterizedCallQuery";

@SuppressWarnings("unchecked")
public <T> T valueAsType(TypeToken<T> typeToken) {
Expand Down Expand Up @@ -708,7 +709,7 @@ private String getSelectedType(Node value, SemanticModel semanticModel) {

private boolean handlePrimitiveType(TypeSymbol typeSymbol, String ballerinaType) {
// Check for SQL query types first
if (SQL_PARAMETERIZED_QUERY.equals(ballerinaType)) {
if (SQL_PARAMETERIZED_QUERY.equals(ballerinaType) || SQL_CALL_QUERY.equals(ballerinaType)) {
type().fieldType(ValueType.SQL_QUERY).ballerinaType(ballerinaType).selected(true).stepOut();
return true;
}
Expand Down
Loading