diff --git a/TopModel.Generator.Sql/Procedural/AbstractSchemaGenerator.cs b/TopModel.Generator.Sql/Procedural/AbstractSchemaGenerator.cs index 4d1b4fd9..8756238f 100644 --- a/TopModel.Generator.Sql/Procedural/AbstractSchemaGenerator.cs +++ b/TopModel.Generator.Sql/Procedural/AbstractSchemaGenerator.cs @@ -78,7 +78,7 @@ public void GenerateListInitScript(IEnumerable classes, IEnumerable c.SqlName), c => c.Properties .OfType() .Select(a => a.Association) - .Where(a => a != c && a.Values.Any())); + .Where(a => a != c && a.Values.Any() && a.IsPersistent)); foreach (var classe in orderList) { diff --git a/TopModel.Generator.Sql/Procedural/ProceduralSqlGenerator.cs b/TopModel.Generator.Sql/Procedural/ProceduralSqlGenerator.cs index 34fe7682..fc8b9b2a 100644 --- a/TopModel.Generator.Sql/Procedural/ProceduralSqlGenerator.cs +++ b/TopModel.Generator.Sql/Procedural/ProceduralSqlGenerator.cs @@ -45,7 +45,7 @@ private AbstractSchemaGenerator SchemaGenerator protected override void HandleFiles(IEnumerable files) { - var classes = Classes.ToList(); + var classes = Classes.Where(c => c.IsPersistent).ToList(); var manyToManyProperties = Classes.SelectMany(cl => cl.Properties).Where(p => p is AssociationProperty ap && ap.Type == AssociationType.ManyToMany).Select(p => (AssociationProperty)p); foreach (var ap in manyToManyProperties) @@ -95,7 +95,7 @@ protected override void HandleFiles(IEnumerable files) private void GenerateListInitScript() { - var classes = Classes.Where(c => c.Values.Any()); + var classes = Classes.Where(c => c.IsPersistent).Where(c => c.Values.Any()); if (classes.Any()) {