vtables

“vtables” stands for “virtual tables” and it is a predefined collection of reference objects for virtual tables generated by using a zref file. Virtual tables are custom table structures you can create in Zontroy based on your database. It is possible to iterate vtables inside a for loop to generate code using virtual table references.

 

Sample Implementation

Input

// ICommonService.java.zsif

import java.util.List;
public interface ICommonService
{
public partial interface ICommonService
{
for(((item:vtables))){{{
List<[[[item.name]]]> GetAll();

[[[item.name]]] Get([[[item.primaryKeyDataType]]] [[[item.primaryKey]]]);

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

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

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

Output

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

Products Get(int ProductID);

void Add(Products Products);

void Update(Products Products);

void Delete(Products Products);

List<Categories> GetAll();

Categories Get(int CategoryID);

void Add(Categories Categories);

void Update(Categories Categories);

void Delete(Categories Categories);

List<Orders> GetAll();

Orders Get(int OrderID);

void Add(Orders Orders);

void Update(Orders Orders);

void Delete(Orders Orders);
}

Input

// ICommonService.cs.zsif
using System;
using System.ServiceModel;
using System.Collections.Generic;
using MyProject.Entities.Concrete;
namespace MyProject.Business.Abstract
{
[ServiceContract]
public partial interface ICommonService
{
for(((item:vtables))){{{
[OperationContract]
List<[[[item.name]]]> GetAll();
[OperationContract]
[[[item.name]]] Get([[[item.primaryKeyDataType]]] [[[item.primaryKey]]]);
[OperationContract]
void Add([[[item.name]]] [[[item.name]]]);
[OperationContract]
void Update([[[item.name]]] [[[item.name]]]);
[OperationContract]
void Delete([[[item.name]]] [[[item.name]]]);
}}}
}
}

Output

// ICommonService.cs

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

[OperationContract]
List<Categories> GetAll();
[OperationContract]
Categories Get(int CategoryID);
[OperationContract]
void Add(Categories Categories);
[OperationContract]
void Update(Categories Categories);
[OperationContract]
void Delete(Categories Categories);

[OperationContract]
List<Orders> GetAll();
[OperationContract]
Orders Get(int OrderID);
[OperationContract]
void Add(Orders Orders);
[OperationContract]
void Update(Orders Orders);
[OperationContract]
void Delete(Orders Orders);
}
}