zg-entity

zg-entity or zg-e

zg-entity is a predefined object to access to fields and properties of a table in the database. You need to write zg-entity with square brackets if you don't use it with a built-in function. In build-in functions it is used with parantheses.

zg-entity object can be used in zsif, zref and ziref file directly.

Example Usage

// access to name field of an entity
[[[zg-entity...zg-name]]]
// or
[[[zg-e...zg-name]]]

Example Usage as a Built-in Function Parameter

// access to name field of an entity and singularize it using built-in function
zg-singularize(((zg-entity...zg-name)))
//or
zg-singularize(((zg-e...zg-name)))

Fields and Properties of zg-entity

Every field and property has a purpose in Zontroy to store spesific data for code generation.

zg-fields or zg-fs

zg-fields is a collection of fields in an entity like columns in a table. You need to iterate zg-fields using zg-for loop to access the properties of each field.

[[[zg-entity...zg-fields]]]
//or
[[[zg-entity...zg-fs]]]
// example usage
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-name]]] }}}

zg-field or zg-f

zg-field or zg-f is each one from a collection of fields in an entity like columns in a table.

//usage
[[[zg-entity...zg-field]]]
// or 
[[[zg-entity...zg-f]]]

zg-pkField" or zg-pk

Returns the field, which is the primary key of any entity in the database.

// usage
[[[zg-entity...zg-pkField...zg-name]]]
// or 
[[[zg-entity...zg-pk...zg-name]]]

zg-pkFields or zg-pks

This is a collection of primary key fields in a table. This property supports multiple primary keys. While iterating list of primary keys you can access the properties of each primary key field.

[[[zg-entity...zg-pkFields]]]
//or
[[[zg-entity...zg-pks]]]

zg-nonPKFields or zg-npks

It is responsible for fetching fields from within the entity that do not have primary keys.

//usage
[[[zg-entity...zg-nonPKFields]]]
//or
[[[zg-entity...zg-npks]]]
// for example
zg-for(((zg-item:::[[[zg-entity...zg-nonPKFields]]]))){{{
[[[zg-item...zg-name]]]
}}}

zg-nonKeyFields or zg-nkfs

It is responsible for fetching fields that do not have primary keys and foreign keys from within the entity.

//usage
zg-for(((zg-item:::[[[zg-entity...zg-nonKeyFields]]]))){{{
[[[zg-item...zg-name]]]
}}}
// or
zg-for(((zg-item:::[[[zg-entity...zg-nkfs]]]))){{{
[[[zg-item...zg-name]]]
}}}

zg-fkFields or zg-fks

Returns fields with foreign keys in the entity.

//usage
zg-for(((zg-item:::[[[zg-entity...zg-fkFields]]]))){{{
[[[zg-item...zg-name]]]
}}}
// or
zg-for(((zg-item:::[[[zg-entity...zg-fks]]]))){{{
[[[zg-item...zg-name]]]
}}}

zg-nonFKFields or zg-nfks

Returns fields in the entity that do not contain foreign keys.

//usage
zg-for(((zg-item:::[[[zg-entity...zg-nonFKFields]]]))){{{
[[[zg-item...zg-name]]]
}}}
// or
zg-for(((zg-item:::[[[zg-entity...zg-nfks]]]))){{{
[[[zg-item...zg-name]]]
}}}

zg-referencingFields or zg-ref

List of referencing fields of an entity is accesible by zg-referencingFields. It also means that zg-referencingFields is a collection of foreign keys in a table.

[[[zg-entity...zg-referencingFields]]]
//or
[[[zg-entity...zg-ref]]]

zg-referencedFields or zg-refs

zg-referencingFields is an object for the list of referenced fields of an entity by another entity. It also means that zg-referencedFields is a collection of columns in a table referenced by another table in the database.

[[[zg-entity...zg-referencedFields]]]
//or
[[[zg-entity...zg-refs]]]

zg-dataType or zg-dt

Returns the data type of any field in the entity.

//usage
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-dataType]]] }}}
// or
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-dt]]] }}}

zg-targetType or zg-tt

It refers to the equivalent of the datatype of a field in an entity in the database in any programming language.

//usage
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-targetType]]] }}}
// for mysql and go 
// datatype of zg-item is bigint, targettype of zg-item is bigint->int64 | so it is int64
// or
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-tt]]] }}}

zg-nullTargetType or zg-ntt

Returns the null target type value in any programming language of the data type of a field in an entity in the database.

//usage
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-nullTargetType]]] }}}
// or
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-ntt]]] }}}

zg-primitiveType or zg-pt

Returns the primitive type value in any programming language of the data type of a field in an entity in the database.

//usage
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-primitiveType]]] }}}
// or
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-pt]]] }}}

zg-default or zg-def

Returns the default value of any field in the entity

zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-default]]] }}}
// or 
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-def]]] }}}

zg-required or zg-r

It is used to express that the value of the field in the entity cannot be empty.

zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-required]]] }}}
// or 
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-r]]] }}}

zg-maxLength or zg-ml

It is used to get the maximum length of the value of the field in the entity.

zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-maxLength]]] }}}
// or 
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-ml]]] }}}

zg-NumericPrecision or zg-np

Precision is the number of digits in a number and finds the precision of the number of digits before the decimal point.

zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-NumericPrecision]]] }}}
// or 
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-np]]] }}}

zg-NumericScale or zg-ns

Scale is the number of digits to the right of the decimal point in a number and deals with the precision of the number of digits after the decimal point.

zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-NumericScale]]] }}}
// or 
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-ns]]] }}}

zg-DatetimePrecision or zg-dp

Indicates how precisely date and time data is recorded. This means that data containing date and time information can be stored in detail down to subunits such as seconds, milliseconds, microseconds.

zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-DatetimePrecision]]] }}}
// or 
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-dp]]] }}}

zg-referencedEntity or zg-re

"zg-referencedEntity" is a term that usually refers to another entity in a system or data model. In relational databases, this refers to the connection of a particular entity to another entity. So Returns the entity that is a reference to the entity.

[[[zg-entity...zg-referencedEntity]]]
// or 
[[[zg-entity...zg-re]]]

zg-referencedEntityName or zg-ren

Returns the entity name that is a reference to the entity.

[[[zg-entity...zg-referencedEntityName]]]
// or 
[[[zg-entity...zg-ren]]]

zg-referencedFieldName or zg-rfn

Returns the field name that is a reference to the field in entity.

zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-referencedFieldName]]] }}}
// or 
zg-for(((zg-item:::[[[zg-entity...zg-fields]]]))){{{
[[[zg-item...zg-rfn]]] }}}

zg-generateBlock

Generate block If we only want code generation in one block of the code file, we add generate block to that section.

zg-generateBlock((([[[zg-entity...zg-pkField...zg-name]]])))

zg-protectBlock

Protect block ensures that the code is not crushed during code generation if we want a part of the existing code to be protected and not changed.

zg-protectBlock((([[[zg-entity...zg-pkField...zg-name]]])))

zg-schema

It means the name of schema in the database.

[[[zg-entity...zg-schema]]]

zg-name or zg-n

It means the name of entity in the database.

[[[zg-entity...zg-name]]]
//or
[[[zg-entity...zg-n]]]

zg-targetName or zg-tn

It means the name of entity given by developer in Zontroy Properties Window.

[[[zg-entity...zg-targetName]]]
//or
[[[zg-entity...zg-tn]]]

zg-alternativeName or zg-an

It means the alternative name of entity given by developer in Zontroy Properties Window.

[[[zg-entity...zg-alternativeName]]]
//or
[[[zg-entity...zg-an]]]

zg-label

It means the label of entity given by developer in Zontroy Properties Window.

[[[zg-entity...zg-label]]]

zg-rowOrder or zg-ro

It means the order of entity given by developer in Zontroy Properties Window. Zontroy sorts entities by value of row order property automatically.

[[[zg-entity...zg-rowOrder]]]
//or
[[[zg-entity...zg-ro]]]

zg-description or zg-d

It means the description of entity given by developer in Zontroy Properties Window.

[[[zg-entity...zg-description]]]
//or
[[[zg-entity...zg-d]]]

zg-displayFields or zg-dfs

zg-displayFields is a collection of fields enterd by developer in Zontroy Properties Window and it is a group of field to use further.

[[[zg-entity...zg-displayFields]]]
//or
[[[zg-entity...zg-dfs]]]

zg-extra1 or zg-e1

zg-extra1 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra1]]]
//or
[[[zg-entity...zg-e1]]]

zg-extra2 or zg-e2

zg-extra2 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra2]]]
//or
[[[zg-entity...zg-e2]]]

zg-extra3 or zg-e3

zg-extra3 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra3]]]
//or
[[[zg-entity...zg-e3]]]

zg-extra4 or zg-e4

zg-extra4 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra4]]]
//or
[[[zg-entity...zg-e4]]]

zg-extra5 or zg-e5

zg-extra5 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra5]]]
//or
[[[zg-entity...zg-e5]]]

zg-extra6 or zg-e6

zg-extra6 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra6]]]
//or
[[[zg-entity...zg-e6]]]

zg-extra7 or zg-e7

zg-extra7 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra7]]]
//or
[[[zg-entity...zg-e7]]]

zg-extra8 or zg-e8

zg-extra8 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra8]]]
//or
[[[zg-entity...zg-e8]]]

zg-extra9 or zg-e9

zg-extra9 is a reserved property to be given by developer for personal purpose in Zontroy Properties Window.

[[[zg-entity...zg-extra9]]]
//or
[[[zg-entity...zg-e9]]]

Last updated