And you can further simplify things by converting
com.mycompany.sample.domain.Order
com.mycompany.sample.domain.LineItem
...
to
in your AnnotationSessionFactoryBean
so now all classes annotated with @Entity
in the com.mycompany.sample.domain
package will be automatically picked up.