org.hibernate.MappingException: Could not determine type for: testenumtype, at table: TestTable, for columns: [org.hibernate.mapping.Column(ENUM)]

Hibernate JIRA | Stefan Schulze | 5 years ago
  1. 0

    If the Configuration first load (i.e. addResource or addDirectory or similar) an entity-mapping and after that a type, which is used by the entity, the call to buildSessionFactory() fails: > org.hibernate.MappingException: Could not determine type for: testenumtype, at table: TestTable, for columns: [org.hibernate.mapping.Column(ENUM)] > at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:305) > at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:289) > at org.hibernate.mapping.Property.isValid(Property.java:238) > at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:468) > at org.hibernate.mapping.RootClass.validate(RootClass.java:270) > at org.hibernate.cfg.Configuration.validate(Configuration.java:1294) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1736) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782) > at de.ckc.sschulze.hibernate.testcase.MyTest.testFirstEntityThenType(MyTest.java:37) In the secondPassCompile the mappings are processed in the order of addition to the Configuration (in case of addDirectory, addJar and addPackage this is quite random). This can cause the HbmBinder not to find the typedef used in an entity, because the typedef is processed after the entity, so the SimpleValue-type is set to the typename in the entity-mapping instead to the name of the type-class. During validation, the TypeResolver is not able to resolve this typename (because it's no basic type and no classname), so a MappingException is thrown. I think this issue could be solved by registering a new SecondPass in HbmBinder if no typedef could be found and the type is not a basictype, which resolves this unresolved type.

    Hibernate JIRA | 5 years ago | Stefan Schulze
    org.hibernate.MappingException: Could not determine type for: testenumtype, at table: TestTable, for columns: [org.hibernate.mapping.Column(ENUM)]
  2. 0

    If the Configuration first load (i.e. addResource or addDirectory or similar) an entity-mapping and after that a type, which is used by the entity, the call to buildSessionFactory() fails: > org.hibernate.MappingException: Could not determine type for: testenumtype, at table: TestTable, for columns: [org.hibernate.mapping.Column(ENUM)] > at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:305) > at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:289) > at org.hibernate.mapping.Property.isValid(Property.java:238) > at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:468) > at org.hibernate.mapping.RootClass.validate(RootClass.java:270) > at org.hibernate.cfg.Configuration.validate(Configuration.java:1294) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1736) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782) > at de.ckc.sschulze.hibernate.testcase.MyTest.testFirstEntityThenType(MyTest.java:37) In the secondPassCompile the mappings are processed in the order of addition to the Configuration (in case of addDirectory, addJar and addPackage this is quite random). This can cause the HbmBinder not to find the typedef used in an entity, because the typedef is processed after the entity, so the SimpleValue-type is set to the typename in the entity-mapping instead to the name of the type-class. During validation, the TypeResolver is not able to resolve this typename (because it's no basic type and no classname), so a MappingException is thrown. I think this issue could be solved by registering a new SecondPass in HbmBinder if no typedef could be found and the type is not a basictype, which resolves this unresolved type.

    Hibernate JIRA | 5 years ago | Stefan Schulze
    org.hibernate.MappingException: Could not determine type for: testenumtype, at table: TestTable, for columns: [org.hibernate.mapping.Column(ENUM)]
  3. 0

    Hibernate mapping. Table related with other two

    Stack Overflow | 1 year ago | Rob
    org.hibernate.MappingException: An association from the table A refers to an unmapped class: Shortcut
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/.../DataConfiguration.class]:

    Stack Overflow | 2 years ago | AixNPanes
    javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
  6. 0

    how to insert values in database using Hibernate in dynamic web project

    Stack Overflow | 2 years ago | Vishnu Ranganathan
    org.hibernate.MappingException: Could not determine type for: String, for columns: [org.hibernate.mapping.Column(email)]

  1. kuldeep 16 times, last 3 months ago
  2. esaar 1 times, last 4 months ago
  3. r1chjames 1 times, last 6 months ago
  4. Kawada 6 times, last 6 months ago
  5. Harsh 1 times, last 8 months ago
34 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hibernate.MappingException

    Could not determine type for: testenumtype, at table: TestTable, for columns: [org.hibernate.mapping.Column(ENUM)]

    at org.hibernate.mapping.SimpleValue.getType()
  2. Hibernate
    Configuration.buildSessionFactory
    1. org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:305)
    2. org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:289)
    3. org.hibernate.mapping.Property.isValid(Property.java:238)
    4. org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:468)
    5. org.hibernate.mapping.RootClass.validate(RootClass.java:270)
    6. org.hibernate.cfg.Configuration.validate(Configuration.java:1294)
    7. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1736)
    8. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782)
    8 frames
  3. de.ckc.sschulze
    MyTest.testFirstEntityThenType
    1. de.ckc.sschulze.hibernate.testcase.MyTest.testFirstEntityThenType(MyTest.java:37)
    1 frame