The error message you got gives you the hint what to do. In your mapping files you have defined a bidirectional relation between User and Video. But in your class definition this relation is missing. In your User class you have to define a Video property and in your video class you have to define a User collection.
Code:
public class User
{
private int _Id;
private string _Name;
private Video _Video
...
public Video Video
{
get { return _Video; }
set { _Video = value; }
}
}
public class Video
{
private int _VideoId;
//private int _UserId; Replaced by _Users!!!
private IList _Users
private string _Description;
...
public IList Users
{
get { return _Users; }
set { _Users = value; }
}
}
Your Query should look llike
Code:
session.CreateQuery("select V.VideoId, V.Users, V.Description from video V");
I have found a nice article about object relational mapping sometimes ago. Here is the link:
http://www.agiledata.org/essays/mappingObjects.html
Regards
Klaus