Hi guys,
I'm having problems with my project, I have a table called CIDADES and in this table there is a column called COD_CIDADE which is CIDADES Primary key.
My EJB Cidades is Mapped like this:
...
@Id
@Column(name="COD_CIDADE", nullable=false)
public Long getCodCidade() {
return codCidade;
}
...
and for some reason hibernate seems to don't find the column COD_CIDADE but it exists. I get the following Exception:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Unable to find column with logical name: CIDADES.COD_CIDADE in org.hibernate.mapping.Table(CIDADES) and its related supertables and secondary tables
javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)
root cause
org.hibernate.MappingException: Unable to find column with logical name: CIDADES.COD_CIDADE in org.hibernate.mapping.Table(CIDADES) and its related supertables and secondary tables
org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:364)
org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:88)
org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:63)
org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:428)
org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
br.com.quasar.util.dao.HibernateUtil.<init>(HibernateUtil.java:24)
br.com.quasar.util.dao.HibernateUtil.getInstance(HibernateUtil.java:17)
br.com.quasar.util.dao.DaoFactory.<init>(DaoFactory.java:19)
br.com.quasar.logica.UserLogic.adiciona(UserLogic.java:23)
br.com.quasar.logica.MyActionListener4.processAction(MyActionListener4.java:27)
javax.faces.event.ActionEvent.processListener(ActionEvent.java:57)
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:649)
javax.faces.component.UICommand.broadcast(UICommand.java:297)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
_____________________________________________________________
I'm using oracle 10g database, tomcat 5.x, java 1.5 and hibernate 3.2.cr4
I'd really appreciate some help =)
Thanks
|