HibernateException « Query « JPA Q&A





1. JPQL: InnerSelect causes PersistenceException (HibernateException: Errors in named queries)    stackoverflow.com

I try to use an inner select, but get only the exception "HibernateException: Errors in named queries" The both JPA entities:

public class A implements Serializable {
   @Id
   @Column(nullable ...

2. org.hibernate.HibernateException: Unexpected row count: 0 expected:    stackoverflow.com

org.hibernate.HibernateException: Unexpected row count: 0 expected:

4. HibernateException: Errors in named queries    forum.hibernate.org

Using Struts 1.3 , Hibernate 3 and Tomcat 5.5v I have a stored procedure that gives values from multiple tables. Java Class to get the data --> List list = null; try { Session session = HibernateUtils.currentSession(); Query query = session.getNamedQuery("SalesForecastSalesRepSummarySp"); query.setParameter("para1", marketID ); query.setParameter("para2", statusID ); query.setParameter("para3",quarterID); query.setParameter("para4", month ); query.setParameter("para5",year ); query.setParameter("para6",customer ); query.setParameter("para7",loggedInUserID); list = query.list(); HibernateUtils.closeSession(); } ...

6. org.hibernate.HibernateException: Could not find datasource    forum.hibernate.org

Can't connect to my database :( using Java Application Server and Pointbase developping in eclipse Exception in thread "main" java.lang.ExceptionInInitializerError at datenbank.HibernateUtil.(HibernateUtil.java:14) at datenbank.HibTest.main(HibTest.java:17) Caused by: org.hibernate.HibernateException: Could not find datasource at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004) at datenbank.HibernateUtil.(HibernateUtil.java:10) ... 1 more Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, ...

7. org.hibernate.HibernateException: Could not find datasource    forum.hibernate.org

I am using the hibernate 3.0 with weblogic server 8.1 and oracle. I am getting the following exception, when I try to execute the program. Created the data source and deployed on the server. Here is the exception: Process started Attached successfully. Test.java .... log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Could ...

8. org.hibernate.HibernateException: could not find file    forum.hibernate.org

hi every body! I have a little problem with a simple example of 'Hello World'. My architecture is: -windows xp pro -IDE: Netbeans 4.1 I don't understand the message error... the file exists... May i must configure Netbeans?... A view of my project path: +Hello1 +build.xml +src +hibernate.cfg.xml +hello1 Main.java Message.java Message.hbm.xml +lib all the lib i need... Hibernate version: the ...

9. HibernateException (Unexpected row count) on delete    forum.hibernate.org

Regular Joined: Mon Aug 29, 2005 9:46 am Posts: 102 Hibernate version: 3.0 Hello everyone, I'm facing a situation in which I get a HE on a delete. The delete does work, but when the transaction is flushed, there's an error. Here's part of my log: Code: 2005-12-26 10:18:54,669 DEBUG org.hibernate.SQL -> delete from MPFICHATECNICA where mpFicha=? Hibernate: delete from ...





10. org.hibernate.HibernateException: Could not find datasource    forum.hibernate.org

Hi, I am getting the following problem. org.hibernate.HibernateException: Could not find datasource , And its occuring at sessionFactory = new Configuration().configure().buildSessionFactory(); in static block of HibernateUtil.java. I am using Tomcat 5.0 and int conf\server.xml i have added the follwoing. factory org.apache.commons.dbcp.BasicDataSourceFactory url jdbc:postgresql://localhost/quickstart ...

11. HibernateException: Errors in named queries    forum.hibernate.org

[ i am using hibernate 3.2] When my query looks like this select count(group) from ClusterGroupDO group where group.name=? I see hibernate error org.hibernate.hql.ast.QuerySyntaxException: unexpected token: group near line 2, column 22 But when I replace "group" above by "g", it works fine select count(g) from ClusterGroupDO g where g.name=? What is the explaination?

12. org.hibernate.HibernateException: Errors in named queries    forum.hibernate.org

Newbie Joined: Fri Feb 02, 2007 11:50 am Posts: 2 Hi Everyone, I am trying to migrate from hibernate2 to hibernate3. I am getting the error in subject while running the code. Here is the error stack: java.lang.ExceptionInInitializerError at com.mftl.gfas.junit.SpringBaseTest.setUp(SpringBaseTest.java:222) at com.mftl.gfas.businessrules.TestBusinessRules.setUp(TestBusinessRules.java:41) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at ...

13. org.hibernate.HibernateException: Errors in named queries    forum.hibernate.org

Guys, I am calling stored procedure from java. Stored Procedure: -------------------- CREATE OR REPLACE PROCEDURE test_APS_payment_report ( o_cur_test_payment_rpt OUT sys_refcursor, i_dt_from_date IN DATE, i_dt_to_date IN DATE ) IS l_cursor VARCHAR2 (4000); l_str_where VARCHAR2 (2500); l_str_select VARCHAR2 (2500); l_str_from VARCHAR2 (500); l_dt_from_date DATE; l_dt_to_date DATE; BEGIN l_dt_from_date := i_dt_from_date; l_dt_to_date := i_dt_to_date; ----------------------Select Statements---------------------------------- l_str_select := ' SELECT pmt_reference_id AS transactionid,'; l_str_select ...

14. org.hibernate.HibernateException: Errors in named queries    forum.hibernate.org

Hibernate version: 3 Mapping documents: JPA Annotations Im using JPA with hibernate. Im able to insert record into db using JPA. when im trying retrieve record from DB using NamedQuery, im getting javax.persistence.PersistenceException: [PersistenceUnit: wsrdatabase] Unable to build EntityManagerFactory Am i missing something? please help me in that. Entity bean: @Entity @Table(name = "employee") @NamedQueries( { @NamedQuery(name = "employee.findAll", query = ...

15. weblogic HibernateException "Errors in named queries"    forum.hibernate.org

hi im trying to deploy an application in a wls 10.3 server, using the hibernate version: hibernate-core-3.3.1.GA (and related) ive allready deployed it in a tomcat server and it worked great! also tried to replace the hibernate library with the last one available, but the same problem occurs every time. any suggestion is welcome. (need more info? just let me know...) ...