-->
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: Error Criteria APi
PostPosted: Mon Dec 12, 2005 11:15 am 
Newbie

Joined: Tue Nov 08, 2005 11:54 am
Posts: 19
I use criteria Api but I get error with execution, my code is:

Iterator iCriteria = session.createCriteria("from FactNegSolicitud fns")
.add(Expression.eq("fns.fEntrada","2005-12-07"))
.add(Expression.eq("fns.fEntrada","2005-12-07"))
.add(Expression.eq("fns.id_solicitud","1"))
.add(Expression.eq("fns.idEmpleadoSolicitante","100"))
.add(Expression.eq("gem.idEmpresa","72"))
.add(Expression.eq("gg.idGrupo","37"))
.list()
.iterator();
I have the next error

org.hibernate.MappingException: Unknown entity: from FactNegSolicitud fns
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:610)
at org.hibernate.impl.SessionImpl.getOuterJoinLoadable(SessionImpl.java:1470)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1436)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
at org.aqua.AQForm.Solicitud.Solicitud.mtsearch(Solicitud.java:277)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at javax.faces.component.UICommand.broadcast(UICommand.java:312)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

THANK FOR ALL


Top
 Profile  
 
 Post subject: Re: Error Criteria APi
PostPosted: Mon Dec 12, 2005 11:34 am 
Regular
Regular

Joined: Sat Nov 05, 2005 5:33 am
Posts: 70
Location: Linz, Austria
vicente wrote:
I use criteria Api but I get error with execution, my code is:

Iterator iCriteria = session.createCriteria("from FactNegSolicitud fns")
...


The string you specified works for HQL not for Criteria API.
Use the following call:
Code:
createCriteria("FactNegSolicitud", "fns");


See createCriteria.

_________________
hth,
Heinz
Don't forget to rate if this helped


Top
 Profile  
 
 Post subject: Criteria
PostPosted: Mon Dec 12, 2005 11:57 am 
Newbie

Joined: Tue Nov 08, 2005 11:54 am
Posts: 19
Ok Thanks, Other question?

But I use any table, for example:

Iterator iCriteria = session.createCriteria("from FactNegSolicitud fns, solicitud solt")


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 12:00 pm 
Regular
Regular

Joined: Sat Nov 05, 2005 5:33 am
Posts: 70
Location: Linz, Austria
Please read the docs. You're still writing HQL.

Docs for Criteria API:
API
Reference

_________________
hth,
Heinz
Don't forget to rate if this helped


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.