src/Cassandra/Mapping/Statements/CqlGenerator.cs
/// <summary>
/// Adds "SELECT columnlist" and "FROM tablename" to a CQL statement if they don't already exist for a POCO of Type T.
/// </summary>
Adds "SELECT columnlist" and "FROM tablename" to a CQL statement if they don't already exist for a POCO of Type T.
Adds " SELECT columnlist " and " FROM tablename " to a CQL statement if they don ' t already exist for a POCO of Type T .
public void AddSelect<T>(Cql cql)
        {
            if (SelectRegex.IsMatch(cql.Statement))
                return;
            var pocoData = _pocoDataFactory.GetPocoData<T>();
            var allColumns = pocoData.Columns.Select(Escape(pocoData)).ToCommaDelimitedString();
            cql.SetStatement(FromRegex.IsMatch(cql.Statement)
                                 ? string.Format("SELECT {0} {1}", allColumns, cql.Statement)
                                 : string.Format("SELECT {0} FROM {1} {2}", allColumns, GetEscapedTableName(pocoData), cql.Statement));
        }
public void AddSelect < T > ( Cql cql ) { if ( SelectRegex . IsMatch ( cql . Statement ) ) return ; var pocoData = _pocoDataFactory . GetPocoData < T > ( ) ; var allColumns = pocoData . Columns . Select ( Escape ( pocoData ) ) . ToCommaDelimitedString ( ) ; cql . SetStatement ( FromRegex . IsMatch ( cql . Statement ) ? string . Format ( " " , allColumns , cql . Statement ) : string . Format ( " " , allColumns , GetEscapedTableName ( pocoData ) , cql . Statement ) ) ; }
Adds "SELECT columnlist" and "FROM tablename" to a CQL statement if they don't already exist for a POCO of Type T.
Adds " SELECT columnlist " and " FROM tablename " to a CQL statement if they don ' t already exist for a POCO of Type T .
// If it's already got a SELECT clause, just bail // Get the PocoData so we can generate a list of columns // If it's got the from clause, leave FROM intact, otherwise add it
cql
Cql