Spring Hibernate JPA 利用原生sql联表查询
测试类 代码片
.
@Test
public void getDeviceStatusList() throws Exception {
String tenantId = "1e88104b7aeab10b6debf3a73521807";
List<Object[]> list = deviceDao.getDeviceStatusList(tenantId);
// 对象类型转换
List<DeviceCustomerAttributeKvEntity> testViews = EntityUtil.castEntity(list, DeviceCustomerAttributeKvEntity.class);
for(DeviceCustomerAttributeKvEntity dca: testViews) {
System.out.println(dca.toString(<