我知道我可以通过使用数据类来做到这一点,但我想实现像这样
// This is My Query
@Query("SELECT loan_amount,adv_interest_amount FROM new_pledge_receive WHERE (new_pledge_receive.bill_date BETWEEN :fromDate AND :toDate)")
fun getPledgeReceiveAmount(fromDate: Long,toDate: Long):LiveData<List<Pair<Double,Double>>> ```
Pair 类有 2 个属性:first
and second
。尝试设置所选列的名称以适合这些名称。
就像是:SELECT my_custom_field as first, my_another_field as second FROM...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)