• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

open JPA throws exception on using Enum

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We have few complex queries to retreive data from database.
started with JPA native named queries.

when I map enum to the filed, JPA throws following exception:



I'm mapping attribute as enum on orm.xml.



I've treid with annotation too.
Getting the same exception..

Any suggestion on this??
Im usign open JPA 1.1.1 version
and sybase database

Thanks,
Lavanya.
 
Pallavi ch
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just realized... Query always returning NULL values for enum from the database, altough database has values.

Read in other forum, enum always loaded as Lazy, need to make it EAGER to get the values.

http://openjpa.208410.n2.nabble.com/OpenJPA-MySQL-Environment-NamedQuery-always-returns-null-for-Enumerated-column-types-td216529.html

I've tried this



but NO luck

Switched to Annotation, and saw the real error in exception stack trace.
error is Query refering to enum values instead of variables.
fixed it and switched back to XML elemenets.
Thanks!
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic