直接上代码:
session.createQuery("From Icurl "); SQLQuery query = session.createSQLQuery("select ENTERPRISE_NAME,ADMIN_DEPT from t_register_enterprise e left join t_website_account a ON e.ID = a.SUBJECT_ID where a.SUBJECT_ID is null;"); query.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP); List companys = query.list(); System.out.println(companys.size()); for(Object object : companys) { Map<String,String> row = (Map)object; System.out.print("First Name: " + row.get("ENTERPRISE_NAME")); System.out.println(", Salary: " + row.get("ADMIN_DEPT")); }
时间: 2024-11-07 17:53:31