Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename relation annotation refs field to keys #277

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -32,7 +32,7 @@ public final class Constants {
public static final String ARRAY = "[]";
public static final String LS = System.lineSeparator();
public static final String SQL_RELATION_MAPPING_ANNOTATION_NAME = "sql:Relation";
public static final String ANNOTATION_REFS_FIELD = "refs";
public static final String ANNOTATION_KEYS_FIELD = "keys";

private Constants() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import java.util.Locale;
import java.util.Map;

import static io.ballerina.stdlib.persist.compiler.Constants.ANNOTATION_REFS_FIELD;
import static io.ballerina.stdlib.persist.compiler.Constants.ANNOTATION_KEYS_FIELD;
import static io.ballerina.stdlib.persist.compiler.Constants.BallerinaTypes.BOOLEAN;
import static io.ballerina.stdlib.persist.compiler.Constants.BallerinaTypes.DECIMAL;
import static io.ballerina.stdlib.persist.compiler.Constants.BallerinaTypes.FLOAT;
Expand Down Expand Up @@ -845,7 +845,7 @@ private void validateRelationAnnotationFieldName(SimpleTypeField field, Entity r
RelationField ownerRelationField) {
List<String> references = readStringArrayValueFromAnnotation
(ownerRelationField.getAnnotations(), Constants.SQL_RELATION_MAPPING_ANNOTATION_NAME,
ANNOTATION_REFS_FIELD);
ANNOTATION_KEYS_FIELD);
if (references == null || !references.contains(field.getName())) {
reportDiagnosticsEntity.reportDiagnostic(PERSIST_422.getCode(), MessageFormat.format(
PERSIST_422.getMessage(), foreignKey, referredEntity.getEntityName()),
Expand Down
Loading