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

本文介绍了如何在Spring Hibernate JPA中使用原生SQL进行联表查询,通过示例代码展示了查询过程,并提供了测试类和实体转换工具类的相关信息。
1005

被折叠的 条评论
为什么被折叠?



