Property class
Use to (optionally) annotate a field to explicitly configure some details about how a field is stored in the database.
For example:
// Store int as a byte (8-bit integer)
@Property(type: PropertyType.byte)
int? byteValue;
See the online docs for details.
Constructors
- Property({PropertyType? type, int? uid, bool signed = true})
-
See Property.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signed → bool
-
For integer property only: set to
false
to treat values as unsigned when executing queries or creating indexes. Defaults totrue
.final - type → PropertyType?
-
Set to store a Dart type as an alternative ObjectBox PropertyType.
final
- uid → int?
-
ObjectBox keeps track of entities and properties by assigning them unique
identifiers, UIDs, during the code-generation phase. All those UIDs are
stored in a file objectbox-model.json in your package and are looked up by
name. If the name changes a new uid is assigned, effectively creating a
new field in the database.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited