Hibernate @OrderBy with referenced class

前端 未结 4 890
广开言路
广开言路 2021-01-12 23:34

I have a class say: \"ClassA\" which has a collection of \"ClassB\"

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = \"COLUMN         


        
4条回答
  •  情话喂你
    2021-01-13 00:10

    I only know NHibernate (.NET version), but I guess it should work similar:

    @OrderBy(clause = "name asc")  
    

    Or you can try this:

    @OrderBy("name")  
    

提交回复
热议问题