Entity Object
Example
Definition
An entity object is used to provide the table name and column names for CRUD statements construction in GoooQo.
The entity struct needs to implement the following interface:
GetId
is used to build aUpdate
statement.SetId
is used to set the generated ID to an entity.GetTableName
is used to provide the table name corresponding to the entity.Each field in the entity needs to correspond to a column in the table.
GoooQo provides two Entity
implementations, IntId
and Int64Id
, to simplify entity definition.
The CRUD statements of the UserEntity
in the example are:
Last updated