This is a full working hibernate version with inheritance