-->
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.  [ 1 post ] 
Author Message
 Post subject: Try to use EntityManager to execute "create table"
PostPosted: Wed Jan 15, 2014 4:34 am 
Newbie

Joined: Tue Jan 14, 2014 12:26 pm
Posts: 2
Hi,

I try to use EntityManager to execute a SQL query (To do "create table" and "insert into").

I would like to do somthing like query.execute(), but I don't know how to do that.

See non working code below (My question isn't returning anything)

I would like to have a hint how to solve this.

Code:
Query query1 = entityManager.createQuery( "create table department_backup like department" );
List<String> dummyList = query1.getResultList();
Query query2 = entityManager.createQuery( "insert into department_backup select * from department" );


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

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.