This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Mapping to an xml typed column (PostgreSQL) on an EJB3 entity in JBoss 5.1

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having fits trying to get a table with an xml typed column in PostgreSQL to update. The Entity is coded as follows:

All of the queries used to select from the relevant table work without a problem. However, when I go to insert/update an entity I get a message stating that the a string (what is coming from the entity) cannot be cast to xml (what is expected on the database. I know this is an issue with the underlying JPA implementation (whatever version of Hibernate is in JBoss 5.1 in this case). However, I am looking for a way, preferably at the JPA declaration level, to convince mapping to cast to the xml type (all that is needed is a CAST(string as xml). I just can't seem to find the magic incantation that does this.

Any constructive help would be appreciated.

author & internet detective
Posts: 39391
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

We have a forum just for ORM and JPA. I'll move this for you. The software helpfully links the original to the moved copy.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!