EDIT: This is not possible with defaults. Entities fetched from repositories are fetched by the provided sorting criteria:
$entities = $entityRepository->findBy(array(), array('field' => 'ASC'));
This, DQL and the Criteria API are the current ways of fetching entities with a given sorting criteria.
What the question at " Default sort attribute for Doctrine Model " is about is the sorting of collection-valued associations, which has nothing to do with direct fetching of entities from repositories.
For those associations, the annotation-equivalent of " Default sort attribute for Doctrine Model " is following (original answer):
As of the official annotations documentation for Doctrine 2 ORM, the annotation for default sorting conditions of collection-valued associations @OrderBy({"field" = "ASC", "otherField" = "DESC"})
.
Here's how you would use it:
/**
* @ORM\OneToMany(targetEntity="Users")
* @ORM\OrderBy({"username" = "ASC"})
*/
protected $users;