如何设置一个关系,以便Spring Roo可以在一个集合中使用多种类型的对象

时间:2023-02-04 06:08:01

My domain thus far looks like:

到目前为止我的域名看起来像:

~.domain.RenderJob
~.domain.RenderLayer
~.domain.ImageLayer extends ~.domain.RenderLayer
~.domain.ColorLayer extends ~.domain.RenderLayer

I'd like to add a set field to RenderJob named 'layers'. Elements in the set can be either of type ImageLayer or ColorLayer, both of which extend RenderLayer. Is there a way to set up the layers field so that it will accept either of the two types of layers?

我想在RenderJob中添加一个名为'layers'的set字段。集合中的元素可以是ImageLayer或ColorLayer类型,它们都扩展了RenderLayer。有没有办法设置图层字段,以便它接受两种类型的图层之一?

1 个解决方案

#1


0  

well I think this will work for you

我认为这对你有用

field set --fieldName layers --element ~.domain.RenderLayer --class ~.domain.RenderJob

Thanks

谢谢

Shekhar

谢卡尔

#1


0  

well I think this will work for you

我认为这对你有用

field set --fieldName layers --element ~.domain.RenderLayer --class ~.domain.RenderJob

Thanks

谢谢

Shekhar

谢卡尔