Hql implementation of the below SQL
I have the following sql as shown below..
SELECT distinct u.name, cast('xxx' as VARCHAR2(13)) as uuu_Type,
u.updated_by, u.updateddate FROM BOA_TYR u where u.FLAG='N' order by
u.name
I have an entity class named posuser I have made the constructor in this
comprise of name ,updated and updateddate, active.. as shown below..
public posuser(String name, DateTime updated, String updatedBy, boolean
active)
{
super();
this.name = name;
this.updatedBy = updatedBy;
this.updated = updated;
this.active = active;
}
Now I have made following HQL as shown below..
List<IOAposuser> uy = (List<IOAposuser>) session
.createQuery("select new com.aaa.posuser(name,
updatedBy,updated) from IOAposuser where active='N' order by
u.name").list();
Now first please advise is this above hql is correct implemetaion of the
above sql and in the sql we are constructiong a new column uuu_Type which
has a value 'xxx' , please advise how this can be embeded in HQL
No comments:
Post a Comment