I got a little problem with a hibernate mapping file.
Here the java files:
Java Code:
public class User {
 
    private String name;
    private int id;
    private String username;
    private String password;
 
//And Getters/Setters
Java Code:
public class Kasten {
    private String Kastenname;
    private int KastenID;
    private User user;
    
//Getters/setters
Java Code:
public class Archiv {
    private Kasten kasten;
    private int f1;
    private int f2;
    private int archiv_ID;
 
//getters/setters
And now I don't exactly know how to write the .xml mapping file for archiv because of the two foreign keys I get from "Kasten".
Here is the archiv-table how it will be stored in the database:
Java Code:
	
CREATE TABLE archiv (
    archiv_id integer NOT NULL,
    f1 integer,
    f2 integer,
    KastenID integer NOT NULL,
    UserID integer NOT NULL,
    PRIMARY KEY(archiv_id),
    FOREIGN KEY(KastenID, UserID) REFERENCES Kasten(KastenID, UserID)
)
Till now I got for the mapping file something like this:

Java Code:
<hibernate-mapping>
 
    <class name="files.Archiv" table="Archiv">
    <id name="archiv_ID" type="int">
        <generator class="increment" />
    </id>
        <many-to-one name="kasten" column="kastenid" class=files.Kasten" not-null="true" cascade="all" unique="true" />
        <property name="f1" type="int" />
        <property name="f2" type="int" />
    </class>
</hibernate-mapping>
Does anybody know how write it?