|composite key order [message #787658]
||Tue, 31 January 2012 21:05
| Tony Rozga
Registered: January 2012
Hi, I have a @Inheritance(strategy=InheritanceType.JOINED) situation with a composite primary key and a base class + a subclass. There doesn't appear to be a way to tell Eclipselink about pk column order so I get two tables with keys in different order.|
any way to fix that? We have a desired order based on selectivity. We are targeting SqlServer and this means we have two clustered keys in different column order...and these two tables get joined. I can't imagine that is good.
I played around with DescriptorCustomizer..setPrimaryKeyFields seems to work for the baseclass..the subclass however has an empty getPrimaryKeyFields and setAdditionalTablePrimaryKeyFields using a LinkedHashMap didn't work.
I guess an alternative is to not rely on automagic ddl and instead roll my own. However, I'm unsure about the implications of doing that, especially when it comes to the efficiency of any queries that get generated by EclipseLink.
Powered by FUDForum
. Page generated in 0.02713 seconds