1

beego中像hibernate的继承映射是什么? https://docs.jboss.org/hibernate/orm/3.5/reference/en-US/html/inheritance.html

beego doc(http://beego.me/docs/mvc/model/orm.md)中没有文档。

像这样的类:

学生扩展人

老师扩展人

4

3 回答 3

2

我认为beego orm还不支持。https://github.com/ataxie/beego/issues/1389这是一个更简单的问题。

于 2015-10-08T09:19:19.130 回答
1

Beego ORM 还不支持。如果你真的需要它。你可以试试 GORM http://jinzhu.me/gorm/

于 2016-09-06T16:17:24.077 回答
0

There is no features like this yet there is an alternative solution
where you can import your controller into another controller.
ex - In ControllerA
type ControllerA struct {
	ControllerB
}
func (this *ControllerA) Test() {
    res := this.DoSomething("Asdasd")
    fmt.Println(res)
}

In Controller B
type ControllerB struct {
	beego.Controller
}
func (this *ControllerB) DoSomething(name string) string{
    return name
}

于 2016-07-28T09:02:37.460 回答