setResultTransformer in Criteria

前端 未结 2 1927
-上瘾入骨i
-上瘾入骨i 2020-12-30 23:45

What is the use of setResultTransformer method in criteria API? Can someone explain this with a simple example? I read the javadocs but i am not able to understand them clea

2条回答
  •  执念已碎
    2020-12-30 23:58

    Simply: when you are doing the Criteria: you want the resultset to be into particular object the you can use it like:eg:

     .setResultTransformer(Transformers.aliasToBean(Employee.class));
    

    Employee should match the ResultSet Entity.

提交回复
热议问题