Madan_Prabhu wrote:
U can use Hibernate Query Language to dynamically create DML statements in hibernate..
use this following link as reference
http://www.hibernate.org/hib_docs/refer ... ryhql.htmlFor eg.,
Code:
Session session=HibernateSessionFactory.getSession();
Transaction txt=session.beginTransaction();
Iterator results=session.createQuery("select u.name,u.age from Users u where u.userId =:uId").setParameter("uId", Integer.parseInt(uid)).iterate();
if(results.hasNext())
{
Object[] e = (Object[]) results.next();
System.out.println("Name: " +e[0].toString());
System.out.println("Age: " +e[1].toString());
}
Like that you can dynamically create queries as you like...
Take a view the link i specified in the first pace of the post...it's very useful for studying HQL basics and ideas..
Thanks for the
quick reply Actually,my problem is that
i want to take backup of all data using hibernate
i m using postgreSql 8.1 as database
Geneally we take database backup using jst right click on database or schema say "Public" and then take backup. Backup is then taken in .backup file.
I want to perform the same operation but using hibernate....
Thanking you!!!!!