EclipseLink 和数据库编码
我是一个全球应用程序的开发人员,该应用程序部署在几个国家,这些国家的语言对我们来说不是问题。但现在,我们要去斯洛伐克,我们在使用 EclipseLink 时遇到了一些问题。
我们设置了一个小型 Web 应用程序来测试他们项目的数据库上的文本编码。我们能够使用 EclipseLink 读取数据,该数据直接插入到数据库(SQL 服务器)上,但是当尝试使用 EntityManager 插入时,EclipseLink 会发送一堆 unicode 字符,这些字符不会被数据库“翻译”,但按原样插入。
到目前为止我还一无所知,因为我尝试在 EclipseLink 上搜索有关此主题的文档,但没有运气。你们能分享一些关于这方面的智慧吗?有人需要使用 ORM 框架支持其他语言,并且可以分享他们的经验吗?
提前致谢!
I am a developer for a global application, which was deployed in a few countries whose languages were not a problem for us. But now, we're going to Slovakia, and we're having a bit of trouble with EclipseLink.
We've setup a small web application to test the text encoding on the database for their project. We're able to read data using EclipseLink, which was inserted directly on the database (SQL server), but when trying to insert using the EntityManager, EclipseLink sends a bunch of unicode chars instead, which are not 'translated' by the database, but inserted as is.
I'm kinda clueless so far, since I've tried to search on EclipseLink for documentation regarding this topic, but had no luck. Can you guys share some of your wisdom regarding this? Anyone had to support other languages using ORM frameworks, and can share their experience?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,这个问题是在 DBMS 级别处理的。包含文本数据的表需要适当的类型才能处理 unicode 字符;对于 SQL Server,此类型为“nvarchar”。
As it turns out, the issue is dealt with at the DBMS level. The tables that contain textual data need an appropriate type in order to handle unicode characters; in the case of SQL server, this type is 'nvarchar'.