diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-19 18:16:30 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-19 18:16:30 +0200 |
| commit | c16f47eb401a12f034eecf75924680262285e1f4 (patch) | |
| tree | f13693f0f5c58edd66211197b5ed360fdab32118 /Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI | |
| parent | 96352ac46ccb871783c63fd98efe034091214b7e (diff) | |
| download | Tango-c16f47eb401a12f034eecf75924680262285e1f4.tar.gz Tango-c16f47eb401a12f034eecf75924680262285e1f4.zip | |
Working on android DAL.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs index ba950f3db..75cfffe50 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs @@ -194,13 +194,16 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Entities... foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { - EntityCodeFileJava codeFile = new EntityCodeFileJava(DalNameToStandardName(table.Name).Singularize(false)) + EntityCodeFileJava codeFile = new EntityCodeFileJava(DalNameToStandardName(table.Name).Singularize(false) + "Base") { EntityName = table.Name.Singularize(false), TableName = table.Name, }; - + EntityCodeFileJavaExtension extensionCodeFile = new EntityCodeFileJavaExtension(DalNameToStandardName(table.Name).Singularize(false), codeFile.Name) + { + TableName = table.Name + }; foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3).Where(x => !x.Name.Contains("GUID"))) { @@ -227,6 +230,9 @@ namespace Tango.DBObservablesGenerator.CLI { codeField.Type = DalNameToStandardName(field.PropertyType.Name).Singularize(false); codeField.Construct = true; + codeField.FieldName = codeField.FieldName.Singularize(false).ToUpper(); + codeField.Description = codeField.Description.Singularize(false); + codeField.Name = codeField.Type; } else if (field.PropertyType == typeof(Byte[]) || field.PropertyType == typeof(Boolean) || field.PropertyType == typeof(Double)) { @@ -242,11 +248,20 @@ namespace Tango.DBObservablesGenerator.CLI } codeFile.IndentResult = false; + extensionCodeFile.IndentResult = false; String code = codeFile.GenerateCode(); + String extensionCode = extensionCodeFile.GenerateCode(); String entitiesPath = Path.Combine(targetPath, "entities"); Directory.CreateDirectory(entitiesPath); File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".java"), code); + + String extensionCodeFilePath = Path.Combine(entitiesPath, extensionCodeFile.Name + ".java"); + + if (!File.Exists(extensionCodeFilePath)) + { + File.WriteAllText(extensionCodeFilePath, extensionCode); + } } //Generate Entities... |
