-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: EJB QL and hibernate entity
PostPosted: Thu Jun 01, 2006 4:07 pm 
Newbie

Joined: Thu Mar 09, 2006 8:16 am
Posts: 13
I have made a program using JBossIDE and JBoss application server
JBoss-4.0.4.GA. My postgreSQL database table partner has columns
master_id varchar(50) and
address varchar(50)

I have also an entity bean Partner which is generated by hibernate reverse engineering

when I execute EJB QL query,

FROM Partner p WHERE LOWER(p.address) LIKE '%some_part%'

I retrieve query result, and all passed ok, but
when I execute same query but now with the column master_id

FROM Partner p WHERE LOWER(p.master_id) LIKE '%some_part%'

I receive a strange error.

javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.QueryException: could not resolve property: master_id of: cash.par.Partner [FROM cash.par.Partner p WHERE LOWER(p.master_id) LIKE 'via bologna'

please help me, I have spent almost 3 days solving that problem.

_________________
nikola_croatia


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 6:31 pm 
Regular
Regular

Joined: Mon May 22, 2006 2:30 pm
Posts: 74
That error would occur if you did not have the "master_id" property mapped. Are you sure it has been mapped correctly? It doesn't seem to know what it is.


Top
 Profile  
 
 Post subject: very close
PostPosted: Fri Jun 02, 2006 8:37 am 
Newbie

Joined: Thu Mar 09, 2006 8:16 am
Posts: 13
Just one more question!

I have used hibernate reverse engineering tool .
How can it be possible that engineering tool has mapped
one column correctly and another not?

When I check my generated Partner.java entity I can see that there also
exist column master_id and appropriate setters and getters.

_________________
nikola_croatia


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 1:27 pm 
Regular
Regular

Joined: Mon May 22, 2006 2:30 pm
Posts: 74
I have to say that I don't quite understand how entity beans fit into the picture when you use Hibernate. I thought the idea was to use Hibernate to replace entity beans, since they are two different approaches to the same problem (O-R mapping). So, if the entity bean has an EJB deployment descriptor, which I think it has to have, perhaps the descriptor doesn't contain that property, even if the Hibernate mappings do.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.