code: public static String getIdColumnName(final KunderaMetadata kunderaMetadata, final EntityMetadata m,
              final Map<String, Object> externalProperties, final boolean isCql3Enabled)
      {
          // key for auto schema generation.
          String persistenceUnit = m.getPersistenceUnit();
          PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
                  .getPersistenceUnitMetadata(persistenceUnit);
          String autoDdlOption = externalProperties != null ? (String) externalProperties
                  .get(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE) : null;
          if (autoDdlOption == null)
          {
              autoDdlOption = persistenceUnitMetadata != null ? persistenceUnitMetadata
                      .getProperty(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE) : null;
          }
  
          boolean containsBasicCollectionField = MetadataUtils.containsBasicElementCollectionField(m, kunderaMetadata);
  
          if (!StringUtils.isBlank(autoDdlOption) && !(isCql3Enabled || containsBasicCollectionField))
          {
              return CassandraConstants.CQL_KEY;
          }
          else
          {
              return ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName();
          }
      }
docs: Return name if Idcolumn for cql, returns {@CassandraConstants.CQL_KEY
  
  
  
  
  
  } if user opted for
  {@PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE
  
  
  
  
  
  } otherwise returns
  JPAColumnName of id attribute.
  
  @param m
  @param externalProperties
  @return