hibernate - Grails 3 Named Foreign Keys -
we have app developed under grails 2, migrated grails 3. when created our original tables, renamed generated foreign keys more human readable. under grails 3, getting exceptions when trying load/run application.
we're using grails 2.3.9, gorm 6.1.6.release, hibernate5 6.1.6
exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.applicationcontextexception: unable start embedded container; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'hibernatedatastoreserviceregistry': cannot resolve reference bean 'hibernatedatastore' while setting constructor argument; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'hibernatedatastore': bean instantiation via constructor failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [org.grails.orm.hibernate.hibernatedatastore]: constructor threw exception; nested exception org.hibernate.tool.schema.spi.schemamanagementexception: unable execute schema management jdbc target [alter table message add constraint fknk6v4vlnstxdwedmm8wp6olvi foreign key (pref_id) references parent_ref]
this complaining following sql attempting run:
alter table message add constraint fknk6v4vlnstxdwedmm8wp6olvi foreign key (pref_id) references parent_ref but existing (slightly redacted) table:
create table message ( id number(19) not null primary key, version number(19) not null, pref_id number(19) not null constraint fk_message_pref references parent_ref, type char(2 char) not null, ) / the foreign key in place, named differently. grails/gorm/hibernate used recognize fk_message_pref valid foreign key, not. there way recognition of existing foreign key?
Comments
Post a Comment