In Hibernate when mapping a byte[] to an Oracle long raw column I receive the exception 'Found: long, expected: raw(255)'

Solution Unverified - Updated -

Issue

  • I am attempting to map a long raw column in Oracle to a Hibernate entity.  When I deploy to JBoss I receive the following error:

    Caused by: org.hibernate.HibernateException: Wrong column type in ABC.ABC_JOBINFO for column data. Found: long, expected: raw(255)
        at org.hibernate.mapping.Table.validateColumns(Table.java:284)
        at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1130)
        at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:358)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:670)
        ... 62 more
    

Environment

  • JBoss Enterprise Application Platform (EAP) 5
  • Hibernate
    CREATE TABLE ABC.ABC_JOBINFO
    (
        JOBID       VARCHAR2(255) NOT NULL,
        COMPLETED   NUMBER(1)         NULL,
        DATA        LONG RAW          NULL,
        MACHINEID   VARCHAR2(255)     NULL,
        LASTUPDATED TIMESTAMP(3)      NULL
    )
    

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content