Package io.realm.annotations
Annotation Type RealmClass
-
@Retention(RUNTIME) @Target(TYPE) @Inherited public @interface RealmClass
Interface used to mark a class that can be persisted by Realm.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
embedded
Define objects of this type as "Embedded".RealmNamingPolicy
fieldNamingPolicy
The naming policy applied to all fields in this class.String
name
Manually set the internal name used by Realm for this class.String
value
Manually set the internal name used by Realm for this class.
-
-
-
Element Detail
-
value
String value
Manually set the internal name used by Realm for this class. If this class is part of any modules, this will also override any name policy set usingRealmModule.classNamingPolicy()
.- Default:
- ""
-
-
-
name
String name
Manually set the internal name used by Realm for this class. If this class is part of any modules, this will also override any name policy set usingRealmModule.classNamingPolicy()
.- Default:
- ""
-
-
-
embedded
boolean embedded
Define objects of this type as "Embedded". Embedded objects have a slightly different behavior than normal objects:- They must have exactly 1 parent linking to them when the embedded object is added to the Realm. Embedded objects can be the parent of other embedded objects. The parent cannot be changed later, except by copying the object.
-
They cannot have fields annotated with
\@PrimaryKey
. - When a parent object is deleted, all embedded objects are also deleted.
-
It is possible to define an easy reference to the parent object using the
\@LinkingObjects
annotation:\@LinkingObjects public Parent parent;
- Default:
- false
-
-
-
fieldNamingPolicy
RealmNamingPolicy fieldNamingPolicy
The naming policy applied to all fields in this class. The default policy isRealmNamingPolicy.NO_POLICY
.It is possible to override the naming policy for each field by using the
RealmField
annotation.- Default:
- io.realm.annotations.RealmNamingPolicy.NO_POLICY
-
-