-
Notifications
You must be signed in to change notification settings - Fork 84
Attribute types
gsharma edited this page Jan 15, 2011
·
4 revisions
Attributes are properties of models typically encapsulated as private or protected members of the model class. They are decorated with @Attribute annotation.
JOhm supports the following Java attribute types:
- Primitives - byte, short, char, int, float, double, long, boolean
- Boxed primitives - Byte, Short, Character, Integer, Float, Double, Long, Boolean.
- Large data types - BigInteger, BigDecimal
- String type
An example of attribute types in a model is:
@Model
class User {
@Id
private Long id;
@Attribute
private String name;
@Attribute
private int age;
}
Users of JOhm should also note that:
- Attribute access modifiers and attribute field names do not play a role in their persistence.
- Collection types and Object-references not in the list above, are handled distinctly from Attribute.
- JOhm treats Collection and Reference as meta-types and will reject either types decorated with @Attribute
- Enums and arrays are not supported at this time but will be soon.