I'm taking a look at Hibernate to see how well it works with the Intersystems Cache database. The dialact org.hibernate.dialect.Cache71Dialect is bundled with Hibernate Core.
I got the following error when trying to load our tables. It was using the JBOSS tool in Eclipse. reading Schema Error: Foreign Key name mapped to different tables.
I'm not sure if this is a problem with Hibernate, the JBOSS tool or the Intersystems dialect/driver. Can anyone help with this?
The crash only happens when Intersystems style 'relationships' are used between tables. Consider the example below.
Tables Customer, Order and Invoice. The tables Order and Invoice both have a column called Customer which is a foreign key to the Customer table. The issue appears to be related to two tables using the same name 'Customer' for foreign keys.
1) There is no problem when the tables are defined in a traditional manner using normal foreign keys. The same column name 'Customer' can be used in the Order and Invoice tables. 2) The error above will happen when Intersystems own style 'one-to-many Relationships' is used to link the Customer column to the Customer table. Both Order and Invoice then have a foreign key to the same table using the same name. 3) Other relationships appear to be ok so far. I've only had a problem when 2 tables link to the same 'parent' using the same column name. 4) The only solution I've found is to rename the columns and re-work the application accordingly.
As the problem is only related to relationships I'm not sure if Intersystems Cache is fully compatible.
|