implemented ordering for media queries in JPA DAL