Hello,
someone can help me ..... with Hibernate, criteria and join.....
I have two tables, one is called the Resource and the other ResourceAttribute.
Table ResourceAttribute there is a field that matches idResource
to their incremental resource table.
For example:
Resource Table
id title private
1 test1 0
2 test2 0
Table ResourceAttribute
id idResource name
.. ......... ....
10 2 hits
I should find all the resource records in the table (with some
restrictions) that are also present in Table ResourceAttribute
where the name field is enhanced with hit.
To solve the first problem this is the query:
Criteria crit = getSession (). CreateCriteria (Risorsa.class);
crit.add (Restrictions.eq ( "private", new Integer (0));
crit.list return ();
simply can not understand how one can take the resources
which are also present in the table where the field ResourceAttribute
name is enhanced with hit.
That is the result of query by example, must have returned a
list of a record (object resource with id = 2 title = test2 ...).
Hello
|