HSL语句:
String queryString="select new com.dio.blog.dto.UserDto(fu.id,fu.username,fu.password) from FriendUser fu where fu.username=?";
选择出的字段保存在UserDto对象里面,UserDto类必须包含该所有字段的构造方法
UserDto代码如下:
package com.dio.blog.dto;
/**
* 用户登录数据传输对象
* @author Administrator
*
*/
public class UserDto {
private String id;
private String username;
private String password;
/**
* 引用数据传输对象,必须有构造方法
* @param id
* @param username
* @param password
*/
public UserDto(String id, String username, String password) {
super();
this.id = id;
this.username = username;
this.password = password;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
分享到:
相关推荐
hibernte缓存hibernte缓存hibernte缓存
eclipse hibernte Tools 插件
spring+springMVC+hibernte+shiro框架(非maven) 空框架,没什么东西,hibernate entities自己改一下就能跑起来 ,也可以用hibernate 生成数据库 ,只做了些登陆验证 ,授权写起来太麻烦。 有点垃圾,请见谅哈!
hibernte 入门
struts+hibernte+spring+jbpm 智能工作流系统 真正的jbpm工作流实战项目,内涵sql构建脚本,安装即可运行!
Hibernate用于读取并解析配置文件,读取并解析映射信息,工作原理:创建SessionFactory;打开Sesssion;创建事务Transation;持久化操作;提交事务;关闭Session;关闭SesstionFactory
struts1.0+spring3.0+hibernte3.2 struts1.0+spring3.0+hibernte3.2
Spring +Struts+HibernteSpring +Struts+Hibernte
NULL 博文链接:https://luxiaofeng2006.iteye.com/blog/792725
NULL 博文链接:https://aa00aa00.iteye.com/blog/1470602
struts2+hibernte+spring权限管理.rar
3大框架的api spring struts hiber api,全部都是chm格式的,详细的介绍了这3个框架的配置,非网页形式,希望能对大家的开发有所帮助。
Hibernate4集成memcache用jar合集 hibernate配置 <property name="hibernate.cache.region.factory_class">com.googlecode.hibernate.memcached.MemcachedRegionFactory</property>
ssh框架的电信计费系统 struts2+spring+hiberntessh框架的电信计费系统 struts2+spring+hiberntessh框架的电信计费系统 struts2+spring+hiberntessh框架的电信计费系统 struts2+spring+hibernte
NULL 博文链接:https://simpleuu.iteye.com/blog/785631
开发基于StrutsSpringHibernateAjax的网上信息发布平台上机贯穿案例Struts+Spring+Hibernte+Ajax(和课件不同) 附带T-SQL语句写的数据库
Java 开发,Spring,Hibernate框架
今天尝试用Hibernate的配置文件生成数据库脚本,结果居然成功了,代码很简单