Selection criteria based on non-primary key columns in Custom-SQL
561998Feb 15 2007 — edited Feb 15 2007Hi all,
Could anybody please tell me how to perform a search using non-primary key columns, The query is written in Workbench under Custom Sql --> Read Object. The Query goes something like this
select * from Employee where firstName like #name
where firstName is a Non-primary key column.
The Java Code goes like this
Employee empm = new Employee();
empm.setFirstName("John");
Employee employees = (Employee) session.readObject(empm);
This does not fetch me any values . I dont want the queries to be written in any java class. Is there Any other way to do it ??