diff --git a/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs b/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs index 09e3c529..f0efc9ba 100644 --- a/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs +++ b/TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs @@ -125,9 +125,10 @@ public void WriteGetter(JavaWriter fw, Class classe, string tag, IProperty prope var type = _config.GetType(ap, _classes, useClassForAssociation: useClassForAssociation).Split('<').First(); if (_newableTypes.TryGetValue(type, out var newableType)) { - fw.WriteLine(indentLevel + 1, $"if(this.{propertyName} == null)"); + fw.WriteLine(indentLevel + 1, $"if(this.{propertyName} == null) {"); fw.AddImport($"java.util.{newableType}"); fw.WriteLine(indentLevel + 2, $"this.{propertyName} = new {newableType}<>();"); + fw.WriteLine(indentLevel + 1, $"}"); } }