Hibernate version: 1.2.1 GA
Hello,
I´m thinking about an architecture to use and came up with some questions. I use an baseclass that provides only identifier functionality. Now i´m searching for the best inheritance strategy in nhibernate.
My baseclass:
Code:
public class BaseUniqueIdentifier {
private Guid guid;
public virtual Guid Guid
{
get
{
if (this.guid == Guid.Empty)
{
this.guid = Guid.NewGuid();
}
return this.guid;
}
set { this.guid = value; }
}
}
Eg for a subclass:
Code:
public class Course
{
private Guid guid;
private string name;
public Course()
{
}
public virtual Guid Guid
{
get
{
if (this.guid == Guid.Empty)
{
this.guid = Guid.NewGuid();
}
return this.guid;
}
set { this.guid = value; }
}
public virtual string Name
{
get { return this.name; }
set { this.name = value; }
}
}
Has anyone an idea? Thank you!
Phil