The Attribute Annotation is used to specify non-transient fields that are serialized to the persisted record.
Attribute | Type | Default | Description |
---|---|---|---|
nullable |
Boolean | true | Indicates whether an attribute can be null upon persisting the entity. This only applies to mutable attributes and not primitive. |
size |
int | -1 | The maximum length of an attribute. This only applies to String attributes. If you specify -1, there is no constraint on String length. |
The following are valid attribute types
Type | Description | Min/Max |
---|---|---|
String |
UTF-8 Encoded Text | |
Integer |
Mutable Integer(can be null) | -2147483648 to 2147483647 |
int |
Immutable Integer(cannot be null) | -2147483648 to 2147483647 |
Long |
Mutable Long(can be null) | -9223372036854775808 to 9223372036854775807 |
long |
Immutable Long(cannot be null) | -9223372036854775808 to 9223372036854775807 |
Double |
Mutable Double(can be null) | 4.9E-324 to 1.7976931348623157E308 |
double |
Immutable Double(cannot be null) | 4.9E-324 to 1.7976931348623157E308 |
Boolean |
Mutable Boolean(can be null) | true/false |
boolean |
Immutable Boolean(cannot be null) | true/false |
Date |
Java Date Time | Sun Dec 02 16:47:04 GMT 292269055 - Sun Aug 17 07:12:55 GMT 292278994 |
Float |
Java Float primitive or mutable | 2^149 to (2-2^23)ยท2^127 |
Byte |
Java Byte primitive or mutable | -128 to 127 |
Short |
Java Short primitive or mutable | -32,768 to 32,767 |
Managed Entity |
Define a managed entity as an attribute rather than a relationship. This is an option if you do not which to make a relational graph. | null |
List |
List of com.onyxdevtools.entities. This is different than defining a relationship. | null |
Enum |
Custom enum value. | null |
Our goal is to bring about change by enabling people to use simple and quality software in order to make sad engineers happy.
Copyright ©2017 Onyx Development Tools, LLC. All rights reserved.