Hi, I am new to hibernate
s.createCriteria(Users.class, "u") .add(Restrictions.eq("u.name", name)) .add(Restrictions.eq("u.city", city)) .addOrder(org.hibernate.criterion.Order.asc("u.createdDate")) .setProjection ( Projections.projectionList() .add(Projections.property("u.name"),"uName") .add(Projections.property("u.surname"),"uSurName") .add(Projections.property("u.city"),"uCity") .add(Projections.property("u.birthDate"),"uBirthDate") ) .setResultTransformer(Transformers.aliasToBean(UserDTO.class));
My code working correctly but i want to select like this
Select name,surname,city,0,'',birthdate from Users
Is it possible ? Thx
|