bulk « Query « JPA Q&A





1. Query syntax error when bulk-deleting in Hibernate    stackoverflow.com

I try to executer bulk delete using Hibernate HQL query, following reference manunal but I get a query syntax error. This line

final Query qry = getSession(false).createQuery(" delete from NewCalendarDay");
causes ...

2. Bulk retrieval in HQL: could not execute native bulk manipulation query    stackoverflow.com

We are getting a "could not execute native bulk manipulation query" error in HQL When we execute a query which is something like this.

String query = "Select person.id from Person person where";
 ...

3. Hibernate: Bulk insert using native query    coderanch.com

Hi all I need to do a bulk insert of raw table data. I need to use a Hibernate native query to insert the data. I know how to do it using objects, but how can I do it using a native query ? Session session = sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); for (int i =0;i<100;i++) { EmployeeInfo employeeInfo = new ...

4. Bulk insert using native query    forum.hibernate.org

Hi all I need to do a bulk insert of raw table data. I need to use a Hibernate native query to insert the data. I know how to do it using objects, but how can I do it using a native query ? Code: ...

5. Getting an error with bulk insert on select.    forum.hibernate.org

Hi, While insert on select i am getting below error. Exception in thread "main" org.hibernate.QueryException: could not resolve property: of: xxx at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:44) at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:1375) at org.hibernate.hql.ast.tree.IntoClause.isSuperclassProperty(IntoClause.java:184) at org.hibernate.hql.ast.tree.IntoClause.visitPropertySpecNodes(IntoClause.java:143) at org.hibernate.hql.ast.tree.IntoClause.visitPropertySpecNodes(IntoClause.java:162) at org.hibernate.hql.ast.tree.IntoClause.initializeColumns(IntoClause.java:125) at org.hibernate.hql.ast.tree.IntoClause.initialize(IntoClause.java:37) at org.hibernate.hql.ast.HqlSqlWalker.createIntoClause(HqlSqlWalker.java:945) at org.hibernate.hql.antlr.HqlSqlBaseWalker.intoClause(HqlSqlBaseWalker.java:839) at org.hibernate.hql.antlr.HqlSqlBaseWalker.insertStatement(HqlSqlBaseWalker.java:479) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:253) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) ...

6. Bulk deletion with ScrollableResults    forum.hibernate.org

7. bulk delete with paths in the where clause    forum.hibernate.org

org.hibernate.hql.ast.QuerySyntaxError: unexpected token: as near line 1, column 58 [delete from net.vickerscraven.learning.hibernate.Address as add where add.owner.firstName = :name] at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83) at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427) at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:865) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89) ...

8. bulk delete: wrong SQL in subquery?    forum.hibernate.org

Hello! Seems like I have subj. Please not the following in my mappings: there is a non-hibernate managed many-to-one relation between Node2 and Data2 entities using dataRef property (I have a number of reasons to for it). The query is intended to delete orphaned Data2 entities. Note that both Node2 and Data2 have an id property mapped to "ID" column. This ...

9. could not insert/select ids for bulk update    forum.hibernate.org

Hibernate version: version 3.1.2 Name and version of the database you are using: MySQL 4.0.18-standard Mapping documents: case 1: Code: ...





10. bulk delete query not working    forum.hibernate.org

I am using hibernate 3.0.5 with MSSQL Server 2005. I have a table with the following xml :

11. HQL-Bulk insert: Incompatible insertion and selection type    forum.hibernate.org

If your posting (or a question you are referring to) was not answered by anybody, the possible reasons are: - http://www.hibernate.org/ForumMailingli ... AskForHelp - You did not submit enough information - Nobody knows the answer or has the free time to answer What you can do now: - Do the things listed in After Posting - Add missing and/or more information ...

12. Bulk Insert with DetachedCriteria Subquery?    forum.hibernate.org

Hi. I am using Hibernate 3.2.4.SP1 and I see that Hibernate now has support for bulk inserts using DML-style HQL. What I am searching for, however, is a way to do a bulk insert via a subquery constructed via a detached criteria. Something like: insert into tempTable (id) select c.id from Customer c where c.id in :dc where :dc is a ...

14. Bulk delete - could not insert/select ids for    forum.hibernate.org

I tried the following code to run a bulk update - I changed the query from a complicated one to this simplest one though makes no sense by itself. However, I got the exception below. I am using Sybase ASE 12 and Hibernate 3. I highlighted the SQL it tried to execute and really don't understand why it did insertion. I ...

15. Bulk select    forum.hibernate.org

16. Bulk queries in Hibernate 3.3 + JbossCache 2.1.1 + Bitronix    forum.hibernate.org

public class HibernateJbc2Test { @Resource private TransactionManager bitronixTransactionManager; @Resource private SessionFactory sessionFactory; //not really a test @Test public void testJbc2() throws SystemException, NotSupportedException, HeuristicRollbackException, HeuristicMixedException, RollbackException { ...





17. could not execute native bulk manipulation query    forum.hibernate.org

Newbie Joined: Wed Jul 15, 2009 1:47 pm Posts: 4 Hello, I'am using a db MS SQL Server 2005. When I generateCreateSchemaScript and do a query.executeSQLQuery("..."); I have an error stack saying this error at top : could not execute native bulk manipulation query In fact, it tries to add foreign key twice, so the db server "throw an exception". Code: ...