Hi,
I have a composite key mapping with a table's primary key. I want to write query either query.hbm or use criteria and select records with restriction(filter criteria) on one of the primary key column.
Suppose A table has APk as primary key having x and y columns then i am writing as below
[code]
Criteria criteria = session.createCriteria(A)
criteria.add(Restrictions.eq("comp_key.x",new Integer(1)));
criteria.list();
[/code]
I get
invalid user.table.column, table.column, or column specification
and the query generated will not have where clause.
here comp_key is the name of the PK in the hbm file and also the bean property inside A. x is of type int.
regards,
Karthik
|