Entity Classes
Last updated
Was this helpful?
Last updated
Was this helpful?
In JFW, each (named as C
+ Entity name
, such as CUser) is a class that represents a data table. It has properties and methods that can be used to manipulate the data.
To retrieve all entities from the database, you can use the static method List. If the method supports it, you can filter the entity list by passing some parameters to the method.
To add a new single Entity, create a new Entity object and then call the Add method to insert the object into the database.
A static method called Get can retrieve an Entity if you pass its ID as an argument. Alternatively, you can use other static methods that start with GetBy... to get an Entity based on different criteria.
CUser aUser = CUser.Get(1); // If there is no Entity with ID = 1, aUser will be null.
To modify the Entity in the database, you can use the Update method.
To delete an Entity, you need to pass its ID to the Delete method. Some methods can also delete an Entity based on other fields.