private XSDKey getTypeKey(String dataModelName, String typeName) throws Exception {
   MetadataRepositoryAdmin repositoryAdmin =
       ServerContext.INSTANCE.get().getMetadataRepositoryAdmin();
   MetadataRepository repository = repositoryAdmin.get(dataModelName);
   ComplexTypeMetadata type = repository.getComplexType(typeName);
   if (type == null) {
     throw new IllegalArgumentException(
         "Type '" + typeName + "' does not exist in data model '" + dataModelName + "'.");
   }
   String[] fields = new String[type.getKeyFields().size()];
   String[] fieldTypes = new String[type.getKeyFields().size()];
   int i = 0;
   for (FieldMetadata keyField : type.getKeyFields()) {
     fields[i] = keyField.getPath();
     String name = keyField.getType().getName();
     if (EUUIDCustomType.AUTO_INCREMENT.getName().equals(name)
         || EUUIDCustomType.UUID.getName().equals(name)) { // See
       // TMDM-6687
       fieldTypes[i] = name;
     } else {
       fieldTypes[i] = "xsd:" + name; // $NON-NLS-1$
     }
     i++;
   }
   return new XSDKey(".", fields, fieldTypes); // $NON-NLS-1$
 }
 @Override
 public void rollback() {
   TransactionManager transactionManager = ServerContext.INSTANCE.get().getTransactionManager();
   transactionManager.currentTransaction().include(this).rollback();
 }