table

“table” is a reference object for tables generated by using a Zontroy Repeating File. The properties of this object type which are predefined in Zontroy are accessible and as follows:

name: name of a table
targetName: target name of a table set by the developer
alternativeName: alternative name of a table set by the developer
label: label of a table
primaryKey: short version of primaryKey.name
primaryKey.dataType: data type of primary key column
displayColumn: short version of displayColumn.name
displayColumn.dataType: data type of display column
extra1: extra field for custom data
extra2: extra field for custom data
extra3: extra field for custom data

 

Sample Implementation

Input

// I[[[table.name]]]Service.java.zref

import java.util.List;
public interface I[[[table.name]]]Service
{
public partial interface I[[[table.name]]]Service
{
List<[[[table.name]]]> GetAll();

[[[table.name]]] Get([[[table.primaryKey.DataType]]] [[[table.primaryKey]]]);

void Add([[[table.name]]] [[[table.name]]]);

void Update([[[table.name]]] [[[table.name]]]);

void Delete([[[table.name]]] [[[table.name]]]);
}
}

Generated Code Files

// IProductsService.java
import java.util.List;
public interface IProductsService
{
List<Products> GetAll();

Products Get(int ProductID);

void Add(Products Products);

void Update(Products Products);

void Delete(Products Products);
}

// ICategoriesService.java
import java.util.List;
public interface ICategoriesService
{
List<Categories> GetAll();

Categories Get(int CategoryID);

void Add(Categories Categories);

void Update(Categories Categories);

void Delete(Categories Categories);
}

// IOrdersService.java
import java.util.List;
public interface IOrdersService
{
List<Orders> GetAll();

Orders Get(int OrderID);

void Add(Orders Orders);

void Update(Orders Orders);

void Delete(Orders Orders);
}

Input

// I[[[table.name]]]Service.cs.zref
using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface I[[[table.name]]]Service
{
[OperationContract]
List<[[[table.name]]]> GetAll();
[OperationContract]
[[[table.name]]] Get([[[table.primaryKey.DataType]]] [[[table.primaryKey]]]);
[OperationContract]
void Add([[[table.name]]] [[[table.name]]]);
[OperationContract]
void Update([[[table.name]]] [[[table.name]]]);
[OperationContract]
void Delete([[[table.name]]] [[[table.name]]]);
}
}

Generated Code Files

// IProductsService.cs

using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface IProductsService
{
[OperationContract]
List<Products> GetAll();
[OperationContract]
Products Get(int ProductID);
[OperationContract]
void Add(Products Products);
[OperationContract]
void Update(Products Products);
[OperationContract]
void Delete(Products Products);
}
}

// ICategoriesService.cs
using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface ICategoriesService
{
[OperationContract]
List<Categories> GetAll();
[OperationContract]
Categories Get(int CategoryID);
[OperationContract]
void Add(Categories Categories);
[OperationContract]
void Update(Categories Categories);
[OperationContract]
void Delete(Categories Categories);
}
}

// IOrdersService.cs
using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface IOrdersService
{
[OperationContract]
List<Orders> GetAll();
[OperationContract]
Orders Get(int OrderID);
[OperationContract]
void Add(Orders Orders);
[OperationContract]
void Update(Orders Orders);
[OperationContract]
void Delete(Orders Orders);
}
}