Metadata to describe the behavior of the underlying database column of a persistent property in ManagedObject subclasses.
By default, simply declaring a a property in a persistent type will make it a database column and its database column will be derived from the proprerty's type. If the property needs additional directives - like indexing or uniqueness - it should be annotated with an instance of this class.
class User extends ManagedObject<_User> implements _User {}
class _User {
@managedPrimaryKey
int id;
@ManagedColumnAttributes(indexed: true, unique: true)
String email;
}
Constructors
- ManagedColumnAttributes({bool primaryKey: false, ManagedPropertyType databaseType, bool nullable: false, String defaultValue, bool unique: false, bool indexed: false, bool omitByDefault: false, bool autoincrement: false })
-
Creates an instance of this type.
const
Properties
- autoincrement → bool
-
Indicate to the underlying database to use a serial counter when inserted an instance.
final - databaseType → ManagedPropertyType
-
The type of the field in the database.
final - defaultValue → String
-
The default value of the property.
final - isIndexed → bool
-
Whether or not the backing database should generate an index for this property.
final - isNullable → bool
-
Indicates whether or not the property can be null or not.
final - isPrimaryKey → bool
-
When true, indicates that this property is the primary key.
final - isUnique → bool
-
Whether or not the property is unique among all instances.
final - shouldOmitByDefault → bool
-
Whether or not fetching an instance of this type should include this property.
final - hashCode → int
-
The hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited