4.1.1.1. Creating an Entity
First, let’s create enumerations. In the Data Model section of the CUBA project tree click New → Enumeration and create the following enumerations:
-
Sexwith values:MALE,FEMALE -
Smokerwith values:YES,NO -
Daywith values:SUN,MON,TUE,WED,THU,FRI,SAT -
Timewith values:DINNER,LUNCH
Let’s create the Tip entity class.
-
In the Data Model section of the CUBA project tree click New → Entity. The New CUBA Entity dialog window will appear.
-
Enter the name of the entity class –
Tip– in the Entity name field, chooseNot persistentfor Entity type and click OK button. The entity designer page will be displayed in the workspace. -
Using Entity Designer add attributes:
-
rowof the typeInteger -
totalBillof the typeDouble -
sexof the enum typeSex -
smokerof the enum typeSmoker -
dayof the enumDay -
timeof the enumTime -
sizeof the typeInteger -
tipof the typeDouble
-
-
Switch to the Text tab. It contains the source code of the
Tipclass.
Tip entity creation is now complete.