-->
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: JPA and creating tables for InnoDb and MyIsam
PostPosted: Mon Jan 16, 2012 10:12 am 
Newbie

Joined: Mon Jan 16, 2012 10:02 am
Posts: 1
Hello,

I'm creating my database schema from the Annotations on Java classes. Previously all my tables have been created as MyIsam tables on MySql. I'm using the org.hibernate.dialect.MySQLDialect dialect.

I have a requirement now to create some new tables to co-exist in the same MySql database as InnoDb.

I'd like to create these as Java classes, annotate them and get them to create the tables when I run up my application the first time.

So my requirement is for, on a clean installation, some tables to be created with MyIsam and some with InnoDb.

I cannot see an annotation or other way to allow this.

I can see it is possible to change the dialect but I want to use the same connection for accessing both so I need a way to specify which tables are which database engine.

One option is to after running the application up to run a SQL script to alter that table thus:

ALTER TABLE CPS_ASSIGNED ENGINE = InnoDB;

However it would be nicer for not need this post-release script.

If anyone had any suggestions I would be very grateful.

Kind regards

Pete


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.