Hibernate version:3.3.0.CR2
Name and version of the database you are using:Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
Hi I have following Problem:
I have 2 Tables:
Table Recht:
<Name> <Type> <PrimaryKey>
UIID VARCHAR2(10 CHAR) 1
RECHTID VARCHAR2(10 CHAR) 2
MODULID VARCHAR2(20 CHAR) 3
RECHT NUMBER(9,0) NO
Table Gruppe:
<Name> <Type> <PrimaryKey>
GRUPPEID VARCHAR2(10 CHAR) 1
GRPTEXT VARCHAR2(50 CHAR) NO
UIID VARCHAR2(10 CHAR) NO
These two Tables are standalone Tables that means no referencing is set at all in the Database (no ForeignKey).
Is it possible to join this tables with the UIID like with this sql command:
select * from gruppe inner join recht on gruppe.uiid= recht.uiid ??
I've tried to map this tables in the gruppe.hbm.xml mapping file:
<hibernate-mapping>
<class name="beans.Gruppe" table="GRUPPE" >
<id name="gruppeid" type="java.lang.String" column="GRUPPEID" length="10">
</id>
<property name="uiid" type="java.lang.String" column="UIID" length="10" />
<property name="grptext" type="java.lang.String" column="GRPTEXT" length="50" />
<set name="rechte" cascade="all" table="Recht">
<key column="UIID"/>
<one-to-many class="beans.Recht" />
</set>
But it doesn't work and the set is always empty.
The set with the name rechte is defined in the Gruppe.java Bean Class with:
Code:
private java.util.Set rechte = new java.util.HashSet();
So as a summary:
I want to get all the Rechte entries that belong to a group entry referenced by the uiid. So I want to join two tables that aren't referenced in any way by the database.
I cannot change the database structure like adding a constraint or something.
Thank you very much for your help!