SchemaTable.fromEntity(ManagedEntity entity)

Creates an instance of this type to mirror entity.

Source

SchemaTable.fromEntity(ManagedEntity entity) {
  name = entity.tableName;

  var validProperties = entity.properties.values
      .where((p) =>
          (p is ManagedAttributeDescription && !p.isTransient) ||
          (p is ManagedRelationshipDescription && p.relationshipType == ManagedRelationshipType.belongsTo))
      .toList();

  _columns = validProperties.map((p) => new SchemaColumn.fromProperty(p)).toList();

  uniqueColumnSet = entity.uniquePropertySet?.map((p) => p.name)?.toList();
}