You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... // another condition met, multiple elif can be used
363
363
[${else}]
364
364
... // condition not met
365
365
${endif}
366
366
```
367
367
368
-
Where `field` is a member of current object(table or column).
368
+
Where `field` is a member of current object(table or column) [decorator](#item-statement)(like .camel, .suffix etc) can be used.
369
+
`conditions` can be added multiple times, in this case all conditions must met to execute `true` part.
370
+
369
371
`conditions` can be one of -
370
372
371
373
|Condition|Description|
372
374
|:---:|:---|
373
375
|`[value\|equals]=<value>`|When item value is equals `<value>`|
374
376
|`notEquals=<value>`|When item value is not equals `<value>`|
375
377
|`startsWith=<prefix>`|When item value starts with `<prefix>`|
378
+
|`notStartsWith=<prefix>`|When item value not starts with `<prefix>`|
376
379
|`endsWith=<suffix>`|When item value ends with `<suffix>`|
380
+
|`notEndsWith=<suffix>`|When item value ends with `<suffix>`|
377
381
|`contains=<item>`|When item collection contains `<item>` or when item is string and `<item>` is `,` separated string then item contained in `<item>`|
378
382
|`notContains=<item>`|When item collection not contains `<item>` or when item is string and `<item>` is `,` separated string then item not contained in `<item>`|
383
+
|`matches=<regex>`|When item value matches with regular expression `<regex>`, regex conformant with [Java Regex](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html)|
384
+
|`notMatches=<regex>`|When item value not matches with regular expression `<regex>`, regex conformant with [Java Regex](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html)|
379
385
380
386
Like many other language, multiple `elif` statement can be used and `else` statement is optional.
381
387
`if` statement must be closed with `endif` statement.
@@ -384,7 +390,7 @@ Examples:
384
390
```
385
391
This is ${if:item="type", startsWith="TABLE"}physical table${else}not table${endif}.
386
392
This is
387
-
${if:item="type", equals="albumId"}
393
+
${if:item="type", equals="TABLE"}
388
394
pysical table
389
395
${elif:item="type", equals="VIEW"}
390
396
virtual view
@@ -470,9 +476,16 @@ is user supplied variable in [Generator Main Window](#generator-main-window).
470
476
|`.prefix`|◯|Remove suffix including last `_` in value(ex. `SAMPLE_ALBUM_T` -> `SAMPLE_ALBUM`)|
471
477
|`.camel`|✕|Change value to camel case(ex. `SAMPLE_ALBUM` -> `sampleAlbum`)|
472
478
|`.pascal`|✕|Change value to pascal case(ex. `SAMPLE_ALBUM` -> `SampleAlbum`)|
479
+
|`.snake`|✕|Change value to snake case(ex. `SAMPLE_ALBUM` -> `sample_album`)|
480
+
|`.screaming`|✕|Change value to screaming snake case(ex. `sample_album` -> `SAMPLE_ALBUM`)|
481
+
|`.skewer`|✕|Change value to skewer case(ex. `sample_album` -> `sample-album`)|
482
+
|`.kebab`|✕|Alias of `.skewer`|
473
483
|`.lower`|✕|Change value to lower case(ex. `SAMPLE_ALBUM` -> `sample_album`)|
474
484
|`.upper`|✕|Change value to upper case(ex. `sample_album` -> `SAMPLE_ALBUM`)|
475
-
|`.replace('X','Y')`|✕|Replace `X` string to 'Y' string(ex. `sample_album``name.replace('album', 'music')` -> `sample_music`)|
485
+
|`.replace('X','Y')`|◯|Replace `X` string to 'Y' string(ex. `sample_album``name.replace('album', 'music')` -> `sample_music`)|
486
+
487
+
> Note! multiple decorators are processed in pipelined manner,
488
+
> in the other words, former decorator result will be the input of latter decorator.
476
489
477
490
`extra decorators` can be a combination of -
478
491
@@ -508,9 +521,9 @@ Databse table object member fields:
|`columns`|Collection|All columns in current table|
512
-
|`keys`|Collection|Primary keys of current table|
513
-
|`notKeys`|Collection|All columns of current table except primary keys.|
524
+
|`columns`|Collection of column object|All columns in current table|
525
+
|`keys`|Collection of column object|Primary key columns of current table|
526
+
|`notKeys`|Collection of column object|All columns of current table except primary keys.|
514
527
515
528
Database column object member fields:
516
529
@@ -543,7 +556,8 @@ There are several utility statements for convenience like,
543
556
|`author`|`${author[:<extra decorator>]}`|User supplied `Author Name` field in [Generator Main Window](#generator-main-window).|
544
557
|`date`|`${date[:format=<date format>]}`|Current date with `date format` which compliant with [SimpleDateFormat](https://docs.oracle.com/en%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2F%2F/java.base/java/text/SimpleDateFormat.html).|
545
558
|`user`|`${user[:<extra decorator>]}`|OS login user ID.|
546
-
|Text|`${"any string can include '${' or '}'"}`|Any text can escape `${` or `}`|
559
+
|`super`|`${super:key=<table member field>[<decorators>][, <extra decorator>]}`|Only available inside of `for` statement, you can access table object using this statement|
560
+
|Text|`${"any string can include '${' or '}'"}`|Statement for escaping `${` or `}`|
0 commit comments