|
14 | 14 | // specific language governing permissions and limitations
|
15 | 15 | // under the License.
|
16 | 16 |
|
17 |
| -# Description. |
18 |
| -# This annotation is used to map an entity/field name to a database table/column name. |
| 17 | +# Maps an entity/field name to a database table/column name. |
| 18 | +# |
19 | 19 | # + name - name of the table/column in the database
|
20 | 20 | public type MapConfig record {|
|
21 | 21 | string name;
|
22 | 22 | |};
|
23 | 23 |
|
| 24 | +# The Annotation used to specify the mapping of an entity/field to a database table/column. |
24 | 25 | public annotation MapConfig Mapping on type, record field;
|
25 | 26 |
|
26 |
| -# Description. |
27 |
| -# This annotation is used to define an Index on a database column. |
28 |
| -# + name - name of the index in the database |
29 |
| -public type SQLIndex record {| |
30 |
| - string name; |
| 27 | +# Marks the entity field as an index field. |
| 28 | +# |
| 29 | +# + names - array of index names associated with the database column |
| 30 | +public type IndexConfig record {| |
| 31 | + string[]? names = (); |
31 | 32 | |};
|
32 | 33 |
|
33 |
| -public annotation SQLIndex Index on record field; |
| 34 | +# The Annotation used to specify the index name associated with a database column. |
| 35 | +public annotation IndexConfig Index on record field; |
34 | 36 |
|
35 |
| -public annotation SQLIndex UniqueIndex on record field; |
| 37 | +# The Annotation used to specify the unique index name associated with a database column. |
| 38 | +public annotation IndexConfig UniqueIndex on record field; |
36 | 39 |
|
37 |
| -# Description. |
38 |
| -# This annotation is used to define a custom max length to a VARCHAR column. |
| 40 | +# Defines a string field as a VARCHAR column and defines its max length. |
| 41 | +# |
39 | 42 | # + length - max length of the VARCHAR column
|
40 | 43 | public type VarCharConfig record {|
|
41 | 44 | int length = 191;
|
42 | 45 | |};
|
43 | 46 |
|
44 |
| -# Description. |
45 |
| -# This annotation is used to define a custom max length to a CHAR column. |
| 47 | +# Defines a string field as a CHAR column and defines its length. |
| 48 | +# |
46 | 49 | # + length - length of the CHAR column
|
47 | 50 | public type CharConfig record {|
|
48 | 51 | int length = 10;
|
49 | 52 | |};
|
50 | 53 |
|
| 54 | +# The Annotation used to specify the max length of a VARCHAR column. |
51 | 55 | public annotation VarCharConfig VarChar on record field;
|
52 | 56 |
|
| 57 | +# The Annotation used to specify the length of a CHAR column. |
53 | 58 | public annotation CharConfig Char on record field;
|
54 | 59 |
|
55 |
| -# Description. |
56 |
| -# This annotation is used to define a custom precision to a DECIMAL column. |
| 60 | +# Defines a custom precision and scale to a DECIMAL column. |
| 61 | +# |
57 | 62 | # + precision - precision of the DECIMAL column as an array of two integers [precision, scale]
|
58 | 63 | public type DecimalConfig record {|
|
59 | 64 | [int, int] precision = [65, 30];
|
60 | 65 | |};
|
61 | 66 |
|
| 67 | +# The Annotation used to specify a custom precision and scale of a DECIMAL column. |
62 | 68 | public annotation DecimalConfig Decimal on record field;
|
63 | 69 |
|
64 |
| -# Description. |
65 |
| -# To specify your own foreign key column in the entity record. |
| 70 | +# Specifies your own foreign key column in the entity record. |
| 71 | +# |
66 | 72 | # + refs - array of key fields in the entity
|
67 | 73 | public type RelationConfig record {|
|
68 | 74 | string[] refs;
|
69 | 75 | |};
|
70 | 76 |
|
| 77 | +# The Annotation used to specify the foreign key column in the entity record. |
71 | 78 | public annotation RelationConfig Relation on record field;
|
72 | 79 |
|
73 |
| -# Description. |
74 |
| -# This annotation is used to denote an entity is auto_increment. |
| 80 | +# Denotes an entity field as a database generated value field. |
| 81 | +# |
75 | 82 | public type GeneratedConfig record {|
|
76 | 83 | |};
|
77 | 84 |
|
| 85 | +# The Annotation used to specify a database generated column in the entity record. |
78 | 86 | public annotation GeneratedConfig Generated on record field;
|
0 commit comments