Grails 2.0的多数据源功能是否支持关系? [英] Does the multiple datasource feature of Grails 2.0 support relations?

查看:64
本文介绍了Grails 2.0的多数据源功能是否支持关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试支持一些旧表,并且能够创建一个使用这些旧表的单独数据源的域.

I'm trying to support some legacy tables and I was able to create a domain that uses a separate datasource of those legacy tables.

但是,当我尝试在hasMany中的单独数据源中使用该域时,它会失败.

However, when I try to use that domain from the separate datasource in a hasMany, it fails.

是否可以将hasMany与其他数据源上的域相关联?

Is it possible to relate hasMany to a domain on a different datasource?

推荐答案

不幸的是,您不能让GORM自动管理多个数据源之间的关联.但是,这就是说,您可以轻松编写代码来完成您要寻找的代码,并同时解决GORM的一些潜在性能问题.

Unfortunately you can not have GORM automatically manage the association across multiple datasources. However, that said you can quite easily write the code that will accomplish what you are looking for and address some of the underlying performance issues with GORM at the same time. There is a very good example of this already.

这篇关于Grails 2.0的多数据源功能是否支持关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆