• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple native SQL

 
S Setty
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you help me to find what i am doing wrong.
I can't seem to get this working.

Query simpleQuery = session.createSQLQuery("select LEGACY_ACCT_IN as legacyIndicator FROM DB2.ACCOUNT_DETAILS WHERE ACCESS_MEDIUM_NO = :acctNum").addEntity(SimpleVO.class);

simpleQuery.setString("acctNum", "4889");

List lst = simpleQuery.list();

Exception data: org.hibernate.MappingException: Unknown entity: common.stmt.business.domain.SimpleVO

Thanks
Santosh
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you declared the SimpleVO class in the Hibernate configuration file?
 
S Setty
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying.

No i do not have anything in the hibernate config file. I was thinking addEntity method will register.

Do you have an example or syntax handy?

Appreciate your help.

Thanks
Santosh
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is very important. Below is an example.

 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic