Hi Subba,
I'm not sure if I understood all aspects of your question. You might want to describe your table structure more clearly and apply normalization rules to your columns.
I'll give this a try by means of MySql DDL:
create table TASK (
TASK_ID int primary key,
TIME timestamp,
TYPE int);
create table NE(
NE_ID int primary key,
NAME varchar(40),
DISPLAYNAME varchar(60),
TASK_ID int);
Given these column names, it becomes clear that NE.TASK_ID is a foreign key referencing table TASK. That is what is meant by proper normalization. Column names like NAME or TIME should be avoided, though.
It then appears to me you are missing some sort of join in your hql. Say you had two pojo classes Task and Ne, with Task.nes being a Set of Ne, a join might look like this:
session.createQuery("from Task as tsk inner join tsk.nes as ne where tsk.taskId=:key and ne.name=:name");
Note that list elements returned by this query will be arrays of Objects.
Hope this helps
Fritz
|