SchemaTable.fromEntity(ManagedEntity 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.fromEntity(entity, p))
      .toList();
}