if (pm.structure().isCounter()) {
throw new IllegalArgumentException(String.format("Cannot prepare statement for property '%s' of entity '%s' because it is a counter type",pm.getPropertyName(),entityMeta.getClassName()));
} else {
Selection select = pm.forStatementGeneration().prepareSelectField(select());
final EntityMetaConfig metaConfig = entityMeta.config();
Select from = select.from(metaConfig.getKeyspaceName(), metaConfig.getTableName());
RegularStatement statement = idMeta.forStatementGeneration().generateWhereClauseForSelect(Optional.fromNullable(pm), from);
return session.prepare(statement.getQueryString());
}
}