开发者

Can a Grails Domain Class inherit from a class that is not a domain class?

开发者 https://www.devze.com 2022-12-14 01:28 出处:网络
I tried to do this, but it insists on their being a table of the base class.I tried usingtablePerHierarchy false as well and that didn\'t make any difference.

I tried to do this, but it insists on their being a table of the base class. I tried using tablePerHierarchy false as well and that didn't make any difference.

I have a few domain classes that share a bunch of methods that operate on an inherited transient field. I had hoped that just having the class over in the non-domain section "/src/..." would be enough for GORM to realize there isn't a base class开发者_开发知识库 in the database.

When I put the class in the src section I get a different error. It no longer maps the specific class. Error 500: org.springframework.orm.hibernate3.HibernateQueryException: Summarypage is not mapped [from Summarypage where id = ?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Summarypage is not mapped [from Summarypage where id = ?]


I figured it out. If the base class is an abstract class it does the right thing.

Thanks anyway everyone.

0

精彩评论

暂无评论...
验证码 换一张
取 消