Entity class

Associates a class with a database table.

Datapod will generate a ManagedEntity wrapper for classes annotated with this, enabling automated state tracking for persistence.

Example:

@Entity(tableName: 'users_table')
class User {
  @Id()
  int? id;

  @Column()
  late String name;
}
Annotations
  • @Target.new({TargetKind.classType})

Constructors

Entity({String? tableName})
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
tableName String?
Optional override for the table name. Defaults to snake_case of class name.
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