Hi,
I need to add something more to johanr's and karldmoore's comments.
It is assumed that you have a reference of type set (java.util.set) in the object class that you told.
Also table1 and table2 like follows.
table_1
ID NAME
table_1
OBJ_ID PERMISSION
meaning that:
Your persistance class or model class looks like follows.
Code:
public class PersistanceObject implements Serializable{
private String name;
private String id;
private Set permissions;
//here you must have relevent getters and setters.
...
...
.....
.
}
you should have a mapping declaration like this.
Code:
<hibernate-mapping>
<class name ="PersistanceObject" table="Table_1">
<id name="id" column="ID">
<generator class="native">
</id>
<property name="name" column="NAME"/>
<set name="permissions" lazy="true" table="table_2">
<key column="OBJ_ID"/>
<element type="string" column="PERMISSION" not-null="true"/>
</set>
</class>
</hibernate-mapping>
Hope this will help you.
/Viraj