Value Types
Built-in: JDK types
Apache Causeway can render and persist all the JDK primitives and wrapper classes, and a number of other JDK classes that represent value types.
It also supports a number of value types that are shipped by the framework itself.
In addition to primitives, the JDK Classes supported are:
-
the wrapper classes (in
java.lang)Integer,Long,Short,Byte,Character,Float,Double,Boolean -
strings and similar:
-
java.lang.String -
any enum (subtype of
java.lang.Enum)
-
-
numeric data types for arbitrary accuracy:
-
java.math.BigDecimalandjava.math.BigIntegerThese can be combined with
@Digitsto specify scale.
-
Built-in: JDK Dates
Dates are also supported of course, though there are lots of options:
-
in the
java.timepackage; these are the most modern and generally is to be preferred:-
local times (no time zone):
java.time.LocalDate,java.time.LocalTime,java.time.LocalDateTime -
for storing date/time, with respect to the UTC:
java.time.OffsetDateTime,java.time.OffsetTime -
primarily for displaying time in a specified time zone:
java.time.ZonedDateTime
-
-
in the
java.utilpackage (usage is discouraged since these classes are not immutable):java.util.Date -
in the
java.sqlpackage:java.sql.Date,java.sql.Timestamp,java.sql.Time
Built-in: Other JDK types
-
miscellaneous:
-
java.net.URL -
java.util.UUID -
java.util.Locale -
java.awt.BufferedImage
-
-
Full Calendar defines its own
CalendarEventvalue type.
Framework-defined
The framework also defines a number of custom value types:
-
Rendered as HTML.
-
Holds a string whose value is suppressed in the UI.
Note that this string is unencrypted. -
Represents a local resource relative to the application’s context root (eg a servlet or controller).
Actions that return results of this type result in a browser redirect to the resource. This is therefore a way to redirect to a custom controller.
-
These can be used to render tree structures.
In addition, there are a number of non-core value types that can be brought in individually:
More details of the above non-core value types can be found in the Value Types catalog.
The core framework also defines a number of value types whose use is primarily internal:
-
anything supported by IdStringifier
Used by the Command Log, Execution Log, Execution Outbox and Session Log externsions modules so that their application primary keys of their corresponding entities are recognised as value types
-
ApplicationFeatureIdValueSemantics
The Schema of XSDs define a number of DTOs (persisted by the above core extensions) which are also recognised as value types:
-
CommandDto (and an XML pretty-render variant)
-
InteractionDto (and an XML pretty-render variant)
-
ChangesDto (and an XML pretty-render variant)
Custom value types
It is also possible to write your own value types, either scalar or composite. For more on this topic, see custom value types topic in the user guide.