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) {
@@Column(name = "@(prop.FieldName)") private @(prop.Type) @(prop.Description);
} else {
@@ForeignKey(references = { @@ForeignKeyReference(columnName = "@(prop.FieldName)_GUID", foreignKeyColumnName = "GUID")}) private @(prop.Type) @(prop.Description);
} } @foreach (var prop in Model.Fields) {
/** * 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)); }
} }