0
Grails是否支持Hibernates @Any註解?我想知道是否和如何。如何在Grails中實現Hibernate @Any?
我可以做這樣的事情實現@Any:
class A {
String entityClass
Long entityId // yes, only support type Long id's
// dynamically load class (e.g. B), then call B.get(entityId)
}
,但我想這樣做更優雅。
Eyal Lupu's blog about Hibernate @Any
想要保持它「全部常規」,但顯然沒有這樣的選擇。 – heikkim