aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJavaExtension.cshtml
blob: 8498f331134da3c8ae778b24b54a08749f0aac05 (plain)
1
2
3
4
5
6
7
8
9
10
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)
{

    
}
ound-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
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 org.joda.time.DateTime;
import com.twine.tango.dal.Entity;
import android.databinding.Bindable;
import com.twine.tango.dal.BR;


    public abstract 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)
         */
         @@Bindable
         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);
            notifyPropertyChanged(BR.@(prop.Description));
         }
     </div>
        }
    }