We are having a problem with ColdFusion 2018 and/or Hibernate 5.2.
We have a series of models for which DDL is generated without issue with ColdFusion 2016, but fails with ColdFusion 2018. We are not sure which (ColdFusion or Hibernate) is ultimately responsible for the issues we are seeing.
There are a few issues:
- Database defaults no longer work
- String defaults are no longer quoted properly.
- This:
property name="CompanyName" fieldtype="column" ormtype="string" default="Acme Inc." dbdefault="Acme Inc.";
- Results in this statement in table create:
CompanyName varchar(255) default Acme Inc.
(missing quotes)
- Database names are no longer quoted properly
- We have databases named like "prefix.databasename" (with dot)
- These used to work find but now in CF2018 results in errors such as "The object name 'prefix.databasename.dbo.SomeTable contains more than the maximum number of prefixes. The maximum is 2."
- Table names are no longer quoted properly
- Frustrating thing is that they are quoted properly sometimes and sometimes not. The following is taken from the hibernate logs:
HIBERNATE DEBUG - alter table my_db.dbo.Group add DeletedByID int HIBERNATE DEBUG - alter table my_db.dbo.User add DeletedByID int HIBERNATE DEBUG - alter table [Group] add constraint FKfpa9ddoqu39xeskmmdg2pe3tq foreign key (DeletedByID) references [User] HIBERNATE DEBUG - alter table [User] add constraint FKj4hy4k4el0vvds8s8itfo2b04 foreign key (DeletedByID) references [User]
- In the first two lines, notice that neither the database name nor the table name are quoted properly (causing the error "Error executing DDL via JDBC Statement - Incorrect syntax near the keyword 'Group'." as it chokes on the table name "Group"). However, in the next two lines it quotes the table names properly and doesn't qualify them with the database name...
- Frustrating thing is that they are quoted properly sometimes and sometimes not. The following is taken from the hibernate logs:
I know somebody is going to weigh in and say that we shouldn't have dots in our table names and we shouldn't have tables named for keywords. Noted, but the bottom line is we do, have done so for years without issue and they are valid names when handled properly.
Has anybody else had similar problems? We're wondering if there is some new configuration setting that we are missing that control this behavior or if there is some other way to force ColdFusion/Hibernate to behave as it previously did. The alternative is to change the database and table names and go hunting through code for any direct references to the old names, but really, really don't want to do that.