Examples

Driver.entity

1
// Entity Driver
2
// Defines a person who is able to drive a car
3
Driver {
4
id : long { @Id } ;
5
firstName : string { @SizeMax(20) @NotEmpty } ;
6
lastName : string { @SizeMax(20) @NotEmpty } ;
7
birthDate : date { @Past };
8
certified : boolean ;
9
}
Copied!

Car.entity

1
// Entity Car
2
// with autoincremented id
3
Car {
4
// basic attributes
5
id : int { @Id @AutoIncremented } ;
6
name : string { @SizeMax(40) } ;
7
year : short { @Min(1900) @Max(2020) } ;
8
price : float { @Min(500) @Max(99999) };
9
10
// links (references to other entities)
11
brand : Brand { @NotNull } ; // 1 Brand
12
driver : Driver[] ; // N driver
13
}
Copied!
Copy link