hibernate的formula的初级使用
- 实体类的一个属性可以对应数据库表里的多个列,这个属性的值由formula 获得<property?formula="。。。"?name="topicCount"/>
- <property?name="rank"?formula="(select?count(*)?from score?s?where?s.student_score>student_score)"/>
- <property?name="name"?formula="concat(first_name,last_name)"/>
- select?concat(first_name,?last_name)?from?user?where?id=1;
- select?(select?count(*)?from?score?s?where?s.score>sc.score)?from score sc where sc.id=1;