mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
CE-1402 Add CaseChangeBehavior sub-section
This commit is contained in:
@ -117,3 +117,19 @@ new QTableMetaData().withName("flights").withFields(List.of(
|
|||||||
.withBehavior(new DateTimeDisplayValueBehavior()
|
.withBehavior(new DateTimeDisplayValueBehavior()
|
||||||
.withDefaultZoneId("UTC"))
|
.withDefaultZoneId("UTC"))
|
||||||
----
|
----
|
||||||
|
|
||||||
|
===== CaseChangeBehavior
|
||||||
|
A field can be made to always go through a toUpperCase or toLowerCase transformation, both before it is stored in a backend,
|
||||||
|
and after it is read from a backend, by adding a CaseChangeBehavior to it:
|
||||||
|
|
||||||
|
[source,java]
|
||||||
|
.Examples of using CaseChangeBehavior
|
||||||
|
----
|
||||||
|
new QTableMetaData().withName("item").withFields(List.of(
|
||||||
|
|
||||||
|
new QFieldMetaData("sku", QFieldType.STRING)
|
||||||
|
.withBehavior(CaseChangeBehavior.TO_UPPER_CASE)),
|
||||||
|
|
||||||
|
new QFieldMetaData("username", QFieldType.STRING)
|
||||||
|
.withBehavior(CaseChangeBehavior.TO_LOWER_CASE)),
|
||||||
|
----
|
||||||
|
Reference in New Issue
Block a user