From 2985c6f5089901d5d1bc494fab283a35f86cfcff Mon Sep 17 00:00:00 2001 From: yhadjal Date: Wed, 17 Jan 2024 11:11:31 +0100 Subject: [PATCH] =?UTF-8?q?correction=20erreurs=20quand=20heritage=20chain?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TopModel.Generator.Jpa/JpaDaoGenerator.cs | 2 +- TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TopModel.Generator.Jpa/JpaDaoGenerator.cs b/TopModel.Generator.Jpa/JpaDaoGenerator.cs index 4c529795..85a64892 100644 --- a/TopModel.Generator.Jpa/JpaDaoGenerator.cs +++ b/TopModel.Generator.Jpa/JpaDaoGenerator.cs @@ -57,7 +57,7 @@ protected override void HandleClass(string fileName, Class classe, string tag) string pk; if (!classe.PrimaryKey.Any() && classe.Extends != null) { - pk = Config.GetType(classe.Extends.PrimaryKey.Single()); + pk = Config.GetType(classe.ExtendedProperties.Single(p => p.PrimaryKey)); } else { diff --git a/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs b/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs index 4dcbab35..c0fdce96 100644 --- a/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs +++ b/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs @@ -266,7 +266,7 @@ private void WriteProperty(JavaWriter fw, Class classe, AssociationProperty prop } fw.AddImport("org.springframework.data.relational.core.mapping.Column"); - fw.WriteLine(1, $@"@Column(""{property.Association.PrimaryKey.First().SqlName.ToLower()}"")"); + fw.WriteLine(1, $@"@Column(""{property.Property.SqlName.ToLower()}"")"); fw.WriteLine(1, $"private {_config.GetType(property)} {property.NameCamel};"); } }