nvarchar in sql ,oracle and mysql in Hibernate annotation mapping

六眼飞鱼酱① 提交于 2019-12-04 05:22:28

问题


We are using MS-SQL ,Oracle and mysql as our database.

We have used hibernate annotations to create tables, in the annotation class file we have declared column definition as

@Column(name="UCAALSNO",nullable=false,columnDefinition="nvarchar(20)") and this works fine for MS-SQL.

But when it comes to Oracle nvarchar throws an exception as oracle supports only nvarchar2 and Mysql only supports nchar()(max length=255)

How to create annotation file to support datatype nvarchar for three databases.

来源:https://stackoverflow.com/questions/23774474/nvarchar-in-sql-oracle-and-mysql-in-hibernate-annotation-mapping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!