diff --git a/TopModel.Generator.Jpa/JpaDaoGenerator.cs b/TopModel.Generator.Jpa/JpaDaoGenerator.cs index 6e736862..4c529795 100644 --- a/TopModel.Generator.Jpa/JpaDaoGenerator.cs +++ b/TopModel.Generator.Jpa/JpaDaoGenerator.cs @@ -21,7 +21,7 @@ public JpaDaoGenerator(ILogger logger) protected override bool FilterClass(Class classe) { - return classe.IsPersistent; + return classe.IsPersistent && (!Config.UseJdbc || classe.PrimaryKey.Count() <= 1); } protected override string GetFileName(Class classe, string tag) diff --git a/TopModel.Generator.Jpa/JpaModelGenerator.cs b/TopModel.Generator.Jpa/JpaModelGenerator.cs index 3424b5f9..6e821b0e 100644 --- a/TopModel.Generator.Jpa/JpaModelGenerator.cs +++ b/TopModel.Generator.Jpa/JpaModelGenerator.cs @@ -92,7 +92,11 @@ protected override void HandleClass(string fileName, Class classe, string tag) } JpaModelPropertyGenerator.WriteProperties(fw, classe, tag); - JpaModelPropertyGenerator.WriteCompositePrimaryKeyClass(fw, classe, tag); + if (!Config.UseJdbc) + { + JpaModelPropertyGenerator.WriteCompositePrimaryKeyClass(fw, classe, tag); + } + JpaModelConstructorGenerator.WriteNoArgConstructor(fw, classe); if (Config.MappersInClass) {