Skip to content

Commit

Permalink
[JPA] Fix formattage hashcode
Browse files Browse the repository at this point in the history
  • Loading branch information
gideruette committed Sep 6, 2024
1 parent 510b7f9 commit aafe5e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void WriteCompositePrimaryKeyClass(JavaWriter fw, Class classe, string ta
fw.WriteLine();
fw.WriteLine(2, "@Override");
fw.WriteLine(2, "public int hashCode() {");
fw.WriteLine(3, $"return Objects.hash({string.Join(", ", classe.PrimaryKey.Select(pk => $"{(pk is AssociationProperty || pk is AliasProperty ap && ap.Property is AssociationProperty ? $"{pk.NameByClassCamel}== null ? null : " : string.Empty)}{pk.NameByClassCamel}{GetterToCompareCompositePkPk(pk)}"))});");
fw.WriteLine(3, $"return Objects.hash({string.Join(", ", classe.PrimaryKey.Select(pk => $"{(pk is AssociationProperty || pk is AliasProperty ap && ap.Property is AssociationProperty ? $"{pk.NameByClassCamel} == null ? null : " : string.Empty)}{pk.NameByClassCamel}{GetterToCompareCompositePkPk(pk)}"))});");
fw.AddImport("java.util.Objects");
fw.WriteLine(2, "}");
fw.WriteLine(1, "}");
Expand Down

0 comments on commit aafe5e0

Please sign in to comment.