0

I am using the dashDB database service of IBM Bluemix to create a cloud application. Well, when I run my app, as hibernate hbm2ddl.auto property is set to update, it will update my dashDB base.

However, the following error appears on the console:

[ERROR ] HHH000388: Unsuccessful: alter table DASH104411.table1 add constraint 
FK_m1vvn3lavq1rjt9oghf0m3x5t foreign key (id_table2) references DASH104411.table2
[ERROR ] DB2 SQL Error: SQLCODE=-1667, SQLSTATE=42858, SQLERRMC=DASH104411.TABLE2;
ORGANIZE BY COLUMN;ENFORCED, DRIVER=4.19.49

I know that, by default, the tables created for dashDB are organized by column and only non-enforced referential constraints are supported. So how do I generate foreign keys that are not enforced by hibernate? Is there a way to generate tables that are organized by row by hibernate?

Islon
  • 5
  • 4

1 Answers1

0

Not aware of a mechanism to have Hibernate generate the create table DDL with the 'organize_by_row' clause. You probably want to use the SQLDB service. See this earlier post - https://developer.ibm.com/answers/questions/21252/how-to-use-ruby-on-rails-with-analytics-warehouse-service-blu-acceleration-on-bluemix.html

  • Indeed, the hbm2ddl doesn't have this flexibility to it. But I saw that Hibernate it has another tool that allows the developer to build your own DLL generator. This topic is very enlightening on the subject: http://stackoverflow.com/questions/438146/hibernate-hbm2ddl-auto-possible-values-and-what-they-do – Islon Apr 05 '16 at 12:48
  • If you are willing to go through some hoops, u can write some code to have Hibernate write out the DDL's in a file (http://jandrewthompson.blogspot.in/2009/10/how-to-generate-ddl-scripts-from.html) . You then edit the file by hand and add the 'organize_by_row' clause to the create table DDL. Now run this file on your dashDB instance – Mario Briggs Apr 07 '16 at 17:19