Hibernate Tutorials/
« Previous | 1 | 2 | 3 | Next »
The most basic SQL query is to get a list of scalars (values) from one or more tables. Following is the syntax for using native SQL for scalar values:

String sql ="SELECT first_name, salary FROM EMPLOYEE";
SQLQuery query =session.createSQLQuery(sql);
query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
List results =query.list();
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com