Skip to content

Commit

Permalink
Merge pull request #277 from hasathcharu/annotation-change
Browse files Browse the repository at this point in the history
Rename relation annotation refs field to keys
  • Loading branch information
daneshk authored Mar 14, 2024
2 parents 733705e + 459b1d2 commit 7048f30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 7048f30

Please sign in to comment.