Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Help with mapping strange table

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

recently I'm making an application with legacy MySQL database. I'm using Hibernate along with JBoss. Everything works fine, but one table in the DB is "strange"


As you can guess bu running SELECT you'll get something like
5 John name
5 B surname
5 Mr. title
5 32 age

now,
when running session.createQuery(...).list(); I get 4 times 'name' collumn.
Running session.createQuery(...).scroll() I get empty ScrollableResult (not much surprise here)
I'm not even capable of mappging User using either @hibernate.bag, or @hibernate.set (I can't use List or map since I can't add index collumn to the DB), as this gives me errror.

XDoclet code:


Error it gives:
12:15:02,468 ERROR [Configuration]
Could not configure datastore from input stream
java.lang.NullPointerException
at net.sf.hibernate.util.StringHelper.qualify(StringHelper.java:241)

I have doubts, whether it is even possible solve this with Hibernate. I could get the data with JDBC, but I'd like to have my code as clean as possible.

Thank you for any advise.

Martin
 
Alas, poor Yorick, he knew this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic