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/Tango.CodeGeneration | |
| parent | 96352ac46ccb871783c63fd98efe034091214b7e (diff) | |
| download | Tango-c16f47eb401a12f034eecf75924680262285e1f4.tar.gz Tango-c16f47eb401a12f034eecf75924680262285e1f4.zip | |
Working on android DAL.
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
5 files changed, 54 insertions, 5 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJava.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJava.cs index 194cd0fc1..0ff4f47d0 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJava.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJava.cs @@ -10,7 +10,7 @@ namespace Tango.CodeGeneration /// Represents a database entity Java code file. /// </summary> /// <seealso cref="Tango.CodeGeneration.Class" /> - public class EntityCodeFileJava : Class + public class EntityCodeFileJava : Class { /// <summary> /// Gets or sets the name of the entity. @@ -18,6 +18,11 @@ namespace Tango.CodeGeneration public String EntityName { get; set; } /// <summary> + /// Gets or sets the extends. + /// </summary> + public String Extends { get; set; } + + /// <summary> /// Gets or sets the name of the table. /// </summary> public String TableName { get; set; } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJavaExtension.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJavaExtension.cs new file mode 100644 index 000000000..99ea437a6 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFileJavaExtension.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + /// <summary> + /// Represents a database entity Java code file. + /// </summary> + /// <seealso cref="Tango.CodeGeneration.Class" /> + public class EntityCodeFileJavaExtension : Class + { + /// <summary> + /// Gets or sets the extends. + /// </summary> + public String Extends { get; set; } + + /// <summary> + /// Gets or sets the name of the table. + /// </summary> + public String TableName { get; set; } + + /// <summary> + /// Initializes a new instance of the <see cref="EntityCodeFileJavaExtension"/> class. + /// </summary> + /// <param name="name">The name.</param> + public EntityCodeFileJavaExtension(String name, String extends) : base(name) + { + Extends = extends; + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index 3c6c9d085..db77d9f20 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -64,6 +64,7 @@ <Compile Include="CodeFile.cs" /> <Compile Include="CodeObject.cs" /> <Compile Include="DpProperty.cs" /> + <Compile Include="EntityCodeFileJavaExtension.cs" /> <Compile Include="EntityCodeFileJava.cs" /> <Compile Include="EntityCodeFile.cs" /> <Compile Include="EnumerationField.cs" /> @@ -111,6 +112,7 @@ <EmbeddedResource Include="Templates\ObservablesContextCodeFile.cshtml" /> <EmbeddedResource Include="Templates\ProtoMessageFile.cshtml" /> <EmbeddedResource Include="Templates\ProtoEnumFile.cshtml" /> + <EmbeddedResource Include="Templates\EntityCodeFileJavaExtension.cshtml" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml index 87c82395b..d9200a718 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml @@ -3,16 +3,13 @@ import com.raizlabs.android.dbflow.annotation.Column; import com.raizlabs.android.dbflow.annotation.ForeignKey; import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; -import com.raizlabs.android.dbflow.annotation.Table; import org.joda.time.DateTime; import com.twine.tango.dal.Entity; -import com.twine.tango.dal.TangoDB; import android.databinding.Bindable; import com.twine.tango.dal.BR; - @@Table(name = "@(Model.TableName)", database = TangoDB.class) - public class @(Model.Name) extends Entity + public abstract class @(Model.Name) extends Entity { @foreach (var prop in Model.Fields) { diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJavaExtension.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJavaExtension.cshtml new file mode 100644 index 000000000..8498f3311 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJavaExtension.cshtml @@ -0,0 +1,11 @@ +package com.twine.tango.dal.entities; + +import com.raizlabs.android.dbflow.annotation.Table; +import com.twine.tango.dal.TangoDB; + +@@Table(name = "@(Model.TableName)", database = TangoDB.class, cachingEnabled = true) +public class @(Model.Name) extends @(Model.Extends) +{ + + +} |
