This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem selecting data from the database: Hibernate

 
Midhun Sivasankaran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm new to Hibernate. When I'm trying to select data from the database, the following exception occurs:

in expected: RELATION [SELECT RELATION.FRID FROM TB_HIBERNATE_RELATION RELATION]

Here is the code which I wrote :

Session session = null;
SessionFactory _factory = new Configuration().configure().buildSessionFactory();
session = _factory.openSession();
org.hibernate.Transaction tx = session.beginTransaction();
String currentFR = "SELECT RELATION.FRID FROM TB_HIBERNATE_RELATION RELATION";
Query query = session.createQuery(currentFR);


Please help me on this: I'm using MS SQL Server2000 database

Thanks,
Midhun
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the stack trace? Can you tell us about the mapping of the class TB_HIBERNATE_RELATION.
 
Midhun Sivasankaran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic