javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2)

Hibernate JIRA | Zeljko Trogrlic | 10 years ago
  1. 0

    I have created reveng.xml file: <hibernate-reverse-engineering> <table catalog="configuration" name="userdb_domain_acl"> <column name="enabled" type="com.siemens.msm.model.mapping.BooleanEnumType" exclude="false"/> </table> </hibernate-reverse-engineering> and included it in build.xml: <jdbcconfiguration propertyfile="build.properties" packagename="${model.package}" revengfile="${project.home}/reveng.xml"/> Generated POJO attribute has proper type, but user type information is missing: @Column(name = "enabled") @Length(max = 42) public Boolean getEnabled() { .... so Hibernate reports error: 3:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl 13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain] 13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Annotations should look like this: @Column(name = "enabled") @Type(type="booleanEnum") public Boolean getEnabled() { ...

    Hibernate JIRA | 10 years ago | Zeljko Trogrlic
    javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2)
  2. 0

    I have created reveng.xml file: <hibernate-reverse-engineering> <table catalog="configuration" name="userdb_domain_acl"> <column name="enabled" type="com.siemens.msm.model.mapping.BooleanEnumType" exclude="false"/> </table> </hibernate-reverse-engineering> and included it in build.xml: <jdbcconfiguration propertyfile="build.properties" packagename="${model.package}" revengfile="${project.home}/reveng.xml"/> Generated POJO attribute has proper type, but user type information is missing: @Column(name = "enabled") @Length(max = 42) public Boolean getEnabled() { .... so Hibernate reports error: 3:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl 13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain] 13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Annotations should look like this: @Column(name = "enabled") @Type(type="booleanEnum") public Boolean getEnabled() { ...

    Hibernate JIRA | 10 years ago | Zeljko Trogrlic
    javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2)
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Specify member of composite key is foreign key

    Oracle Community | 10 years ago | 843830
    javax.persistence.PersistenceException: org.hibernate.MappingException: Repeated column in mapping for entity: autosas_ejb.AdvisingFormEntry column: A (should be mapped with insert="false" update="false")

  1. Piz 7 times, last 4 months ago
2 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. javax.persistence.PersistenceException

    org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar( 2)

    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()
  2. Hibernate EJB
    HibernatePersistence.createContainerEntityManagerFactory
    1. org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
    2. org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
    2 frames
  3. org.jboss.ejb3
    PersistenceUnitDeployment.start
    1. org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
    1 frame
  4. Java RT
    NativeMethodAccessorImpl.invoke0
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    1 frame