org.hibernate.MappingException: Could not determine type for: test.convert.MyType, at table: Parent, for columns: [org.hibernate.mapping.Column(myType)]

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I use JPA @Converter with auto-apply. It works with Hibernate Configuration, but fails with Spring LocalSessionFactoryBean. See ConvertTest and SpringConvertTest respectively in attached testcase. org.hibernate.MappingException: Could not determine type for: test.convert.MyType, at table: Parent, for columns: [org.hibernate.mapping.Column(myType)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:336) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:310) at org.hibernate.mapping.Property.isValid(Property.java:241) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:496) at org.hibernate.mapping.RootClass.validate(RootClass.java:270) at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928) at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:363) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:453) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:438) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564) ... 40 more LocalSessionFactoryBean only works when @Convert(converter=MyConverter.class) is explicitly declared at property Parent.myType. Walking through the source, LocalSessionFactoryBuilder.defaultTypeFilters includes scanning of @Converter and eventually calls addAnnotatedClass(); addAttributeConverter() should be called instead.
    via by Samuel Fung,
  • I use JPA @Converter with auto-apply. It works with Hibernate Configuration, but fails with Spring LocalSessionFactoryBean. See ConvertTest and SpringConvertTest respectively in attached testcase. org.hibernate.MappingException: Could not determine type for: test.convert.MyType, at table: Parent, for columns: [org.hibernate.mapping.Column(myType)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:336) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:310) at org.hibernate.mapping.Property.isValid(Property.java:241) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:496) at org.hibernate.mapping.RootClass.validate(RootClass.java:270) at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928) at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:363) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:453) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:438) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564) ... 40 more LocalSessionFactoryBean only works when @Convert(converter=MyConverter.class) is explicitly declared at property Parent.myType. Walking through the source, LocalSessionFactoryBuilder.defaultTypeFilters includes scanning of @Converter and eventually calls addAnnotatedClass(); addAttributeConverter() should be called instead.
    via by Samuel Fung,
  • Hibernate Embedded class as NaturalId
    via Stack Overflow by Dariush Jafari
    ,
    • org.hibernate.MappingException: Could not determine type for: test.convert.MyType, at table: Parent, for columns: [org.hibernate.mapping.Column(myType)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:336) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:310) at org.hibernate.mapping.Property.isValid(Property.java:241) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:496) at org.hibernate.mapping.RootClass.validate(RootClass.java:270) at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928) at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:363) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:453) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:438) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564)

    Users with the same issue

    Unknown visitor2 times, last one,
    Unknown visitor1 times, last one,
    Kawada
    Kawada193 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    50 more bugmates