Hi,
I have a problem with table mapping, I cannot find any error, maybe I have badly written composite-key... Table name and class name is Player_in_Tournament, there is no error...
Error:
Could not compile the mapping document: Player_in_Tournament.hbm.xml
Web Form where the Exception is raised:
protected void btnRegister_Click(object sender, EventArgs e)
...
new Insert_Player().Create_Player(tbNickname.Text, tbName.Text, tbSurname.Text, gender, tbEmail.Text);
...
Tournament.hbm.xml:
="1.0"="utf-8"
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Entities"
assembly="Entities">
<class name="Player_in_Tournament" table="Player_in_Tournament">
<composite-id>
<key-property name="Player_ID" column="Player_ID" type="string" />
<key-property name="Tournament_ID" column="Tournament_ID" type="int" />
</composite-id>
<property name="Team_ID" column="Team_ID" type="int"/>
<property name="Pozice" column="Pozice" type="string"/>
</class>
</hibernate-mapping>
Player_in_Tournament_ID:
public class Player_in_Tournament_ID
{
public virtual String Player_ID { get; set; }
public int Tournament_ID { get; set; }
public override bool Equals(object obj)
{
if (obj == null)
return false;
Player_in_Tournament_ID id = (Player_in_Tournament_ID)obj;
if (id == null)
return false;
if (Player_ID == id.Player_ID && Tournament_ID == id.Tournament_ID)
return true;
return false;
}
}
Player_in_Tournament:
public class Player_in_Tournament
{
public virtual Player_in_Tournament_ID Player_in_Tournament_ID { get; set; }
public virtual int Team_ID { get; set; }
public virtual String Pozice { get; set; }
}
Can anyone solve this error?
Thanks!
-Pepin z Hane