org.hibernate.MappingException:否JDBC类型的方言映射:1111

问题描述:

Initial SessionFactory creation failed.org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
    27 Dec, 2012 6:38:34 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet commission threw exception
    org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
        at org.hibernate.dialect.TypeNames.get(TypeNames.java:79)
        at org.hibernate.dialect.TypeNames.get(TypeNames.java:104)
        at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:347)
        at org.hibernate.mapping.Column.getSqlType(Column.java:208)
        at org.hibernate.mapping.Table.sqlCreateString(Table.java:419)
        at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:930)
        at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:105)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:383)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
        at com.core.commission.HibernateUtil.<clinit>(HibernateUtil.java:15)
        at com.core.commission.service.BaseCommissionService.saveRules(BaseCommissionService.java:48)
        at com.core.commission.service.BaseCommissionService.processSave(BaseCommissionService.java:22)
        at com.core.web.CommissionServlet.processRequest(CommissionServlet.java:51)
        at com.core.web.CommissionServlet.doPost(CommissionServlet.java:34)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

在启动Web服务器时出现以上错误。
我已经使用enity类的枚举映射。就像... ...

I am getting above error while starting the web server. I have used enum mapping with enity class. Something like...

@Column(name = "commission_type")
        @Type(type = "com.core.commission.model.FNEnumUserType", parameters = @Parameter(name = "type", value = "com.core.commission.dto.CommissionType"))
        private CommissionType commissionType;

什么是问题,我错过配置中的任何东西?谢谢!!

What is the issue, do i missed anything in configuration ? Thanks !!

堆栈跟踪告诉您的是,Hibernate正在初始化自己,特别是执行 Configuration.generateSchemaCreationScript ,它会遍历所有映射表并为它们生成DDL。作为其中的一部分,它查询现有的列并将它们转换为内部Hibernate表示。它通过调用 ResultSetMetaData :: getColumnType ,然后调用 TypeNames :: get 和结果类型代码。问题是 getColumnType 返回的是1111的类型代码,这意味着' other '),而Hibernate不知道该怎么做。

What the stack trace tells you is that Hibernate is in the process of initialising itself, and in particular, is executing Configuration.generateSchemaCreationScript, which goes through all your mapped tables and generates DDL for them. As part of this, it queries the existing columns and converts them into an internal Hibernate representation. It does this by calling ResultSetMetaData::getColumnType and then calling TypeNames::get with the resulting type code. The problem is that getColumnType is returning a type code of 1111, which means 'other'), and Hibernate doesn't know what to do with that.

基本上,表中的某处是Hibernate无法处理的类型的列。如果你能弄清楚哪一列,你可以开始考虑如何处理它。

Basically, somewhere in one of your tables is a column of a type Hibernate can't handle. If you can work out which column that is, you can start thinking about what to do about it.