Skip to content
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:

  1. Primitives - byte, short, char, int, float, double, long, boolean
  2. Boxed primitives - Byte, Short, Character, Integer, Float, Double, Long, Boolean.
  3. Large data types - BigInteger, BigDecimal
  4. 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.