diff options
| author | Avi Levkovich <avi@twine-s.com> | 2017-12-19 12:28:20 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2017-12-19 12:28:20 +0200 |
| commit | 76aa983631df4fa5b16b170e2f6dd845c5ac9531 (patch) | |
| tree | 6b2b4d0776c54536ec07aabc6be94857dcee91fc /Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml | |
| parent | 6bf71c81050b824398dc82ce4b69cdf71fb4a2f7 (diff) | |
| parent | b421701fd5cf000a16cab9b1fe9eda812ccce8c3 (diff) | |
| download | Tango-76aa983631df4fa5b16b170e2f6dd845c5ac9531.tar.gz Tango-76aa983631df4fa5b16b170e2f6dd845c5ac9531.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml')
| -rw-r--r-- | Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml new file mode 100644 index 000000000..aeba15b12 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml @@ -0,0 +1,59 @@ +package com.twine.tango.dal.entities; + +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; + + + @@Table(name = "@(Model.TableName)", database = TangoDB.class) + public class @(Model.Name) extends Entity + { + @foreach (var prop in Model.Fields) + { + if (!prop.Construct) + { + <div> + @@Column(name = "@(prop.FieldName)") + private @(prop.Type) @(prop.Description); + + </div> + } + else + { + <div> + @@ForeignKey(references = { @@ForeignKeyReference(columnName = "@(prop.FieldName)_GUID", foreignKeyColumnName = "GUID")}) + private @(prop.Type) @(prop.Description); + + </div> + } + } + + @foreach (var prop in Model.Fields) + { + <div> + /** + * Gets the @(prop.Name). + * + * return the @(prop.Name) + */ + public @(prop.Type) @(prop.Type == "Boolean" ? "is" + prop.Name : "get" + prop.Name)() + { + return @(prop.Description); + } + + /** + * Sets the @(prop.Name). + * + * @@param @(prop.Description) the @(prop.Name) + */ + public void set@(prop.Name)(@(prop.Type) @(prop.Description)) + { + this.@(prop.Description) = @(prop.Description); + } + </div> + } + } |
