vtable

“vtable” stands for “virtual table” and it is a reference object for virtual tables generated by using a zref file. Virtual tables are custom table structures you can create in Zontroy based on your database. The properties of this object type which are predefined in Zontroy are accessible and as follows:

name: name of a virtual table
label: label of a virtual 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

 

Sample Implementation

Input

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

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

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

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

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

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

Output

// 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[[[vtable.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[[[vtable.name]]]Service
{
[OperationContract]
List<[[[vtable.name]]]> GetAll();
[OperationContract]
[[[vtable.name]]] Get([[[vtable.primaryKeyDataType]]] [[[vtable.primaryKey]]]);
[OperationContract]
void Add([[[vtable.name]]] [[[vtable.name]]]);
[OperationContract]
void Update([[[vtable.name]]] [[[vtable.name]]]);
[OperationContract]
void Delete([[[vtable.name]]] [[[vtable.name]]]);
}
}

Output

// 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);
}
}