HHH-13752 - Workaround id class issues like suggested by @jwgmeligmeyling
This commit is contained in:
parent
8f563fbd31
commit
a2f7f59de4
|
@ -11,6 +11,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.engine.spi.QueryParameters;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
|
@ -82,10 +83,16 @@ public class DeleteExecutor extends BasicExecutor {
|
|||
if ( keyType.isComponentType() ) {
|
||||
ComponentType componentType = (ComponentType) keyType;
|
||||
List<String> columns = new ArrayList<>( componentType.getPropertyNames().length );
|
||||
for ( String propertyName : componentType.getPropertyNames() ) {
|
||||
Collections.addAll( columns, persister.toColumns( propertyName ) );
|
||||
try {
|
||||
for ( String propertyName : componentType.getPropertyNames() ) {
|
||||
Collections.addAll( columns, persister.toColumns( propertyName ) );
|
||||
}
|
||||
columnNames = columns.toArray( new String[0] );
|
||||
}
|
||||
catch (MappingException e) {
|
||||
// Property not found, due to IdClasses are not properly handled in metamodel HHH-12996
|
||||
columnNames = persister.getIdentifierColumnNames();
|
||||
}
|
||||
columnNames = columns.toArray( new String[columns.size()] );
|
||||
}
|
||||
else {
|
||||
columnNames = persister.getIdentifierColumnNames();
|
||||
|
|
Loading…
Reference in New Issue